﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO.Ports;
using System.Text.RegularExpressions;
using System.Threading;
using System.Reflection; // 引用这个才能使用Missing字段
using System.Data.OleDb;
using System.Data.SqlClient;
using System.Xml;
using System.Web;
using System.Runtime.InteropServices;
using System.Net.Sockets;
using System.Net;
using System.IO;
using CCWin;
using Newtonsoft.Json;
using LitJson;
using Newtonsoft.Json.Linq;
using System.Data;
using System.Windows.Forms;

namespace weiqijiance.联网通信协议
{
   public class  LWZhiHuiHuanBao : LWbass
    {
        public LWZhiHuiHuanBao()
        {
            objdb = new 数据库操作.DBweiqi();
        }
        // 用于设置系统时间  
        public string decode(string str)//utf8转中文
        {
            Encoding utf8 = Encoding.UTF8;
            // 首先用utf-8进行解码                    
            return HttpUtility.UrlDecode(str.ToUpper(), utf8);
        }
        public string encode(string str)//中文转utf8
        {
            Encoding utf8 = Encoding.UTF8;
            return HttpUtility.UrlEncode(str, utf8);
        }

        public string Query(string skid,string vehispara,string shphm)
        {
            string result = "";
            WebReferenceZHHB.WSServiceImplService m_vesd = new WebReferenceZHHB.WSServiceImplService();
            m_vesd.Url = m_mainform.surl;
            result = m_vesd.query(vehispara);
            m_mainform.writetext(skid, vehispara, shphm);
            m_mainform.writetext(string.Format(@"{0}返回", skid), result, shphm);
            return result;
        }

        public string Write(string skid, string vehispara, string shphm)
        {
            string result = "";
            WebReferenceZHHB.WSServiceImplService m_vesd = new WebReferenceZHHB.WSServiceImplService();
            m_vesd.Url = m_mainform.surl;
            result = m_vesd.write(vehispara);
            m_mainform.writetext(skid, vehispara, shphm);
            m_mainform.writetext(string.Format(@"{0}返回", skid), result, shphm);
            return result;
        
        }

        public override void insertjcwc(string slsh)//检测完成标志
        {
            string sqlxzxx = string.Format(@"update SHWD_GetGas set jcwc=1 where jcCarCheckSerialNumber='{0}' ", slsh);
            m_mainform.objbass.objdb.InsertDB(sqlxzxx);
        }

        public override void getstandxz(string slsh)
        {
            if (mainform.methodId.Contains("DB") || mainform.methodId.Contains("双怠速"))//shaungdaishu双怠速
            {
                string sqlSDS;
                if (true)
                {
                    sqlSDS = string.Format(@"Select *  from XZ001_SDS where lx='A'");
                }
                else
                {
                    sqlSDS = string.Format(@"Select *  from XZ001_SDS  where lx='B'");
                }
                DataTable dtSDS = objdb.GetTable(sqlSDS);
                if (dtSDS.Rows.Count > 0)
                {
                    float.TryParse(dtSDS.Rows[0]["dsco"].ToString().Trim(), out m_mainform.LICOL);
                    float.TryParse(dtSDS.Rows[0]["dshc"].ToString().Trim(), out m_mainform.LIHCL);
                    float.TryParse(dtSDS.Rows[0]["gdsco"].ToString().Trim(), out m_mainform.HICOL);
                    float.TryParse(dtSDS.Rows[0]["gdshc"].ToString().Trim(), out m_mainform.HIHCL);
                }
            }
            else if (mainform.methodId.Contains("WT") || mainform.methodId.Contains("ASM"))//ASM
            {
                //ASM
                string sql;
                sql = string.Format(@"Select *  from XZ001_ASM  ");
                if (true)
                {
                    sql = string.Format(@"Select *  from XZ001_ASM  where lx='A'  ");
                }
                else
                {
                    sql = string.Format(@"Select *  from XZ001_ASM  where lx='B'  ");
                }
                DataTable dt = objdb.GetTable(sql);
                if (dt.Rows.Count > 0)
                {
                    float.TryParse(dt.Rows[0]["asm5025hc"].ToString().Trim(), out m_mainform.HCEL5025);
                    float.TryParse(dt.Rows[0]["asm5025co"].ToString().Trim(), out m_mainform.COEL5025);
                    float.TryParse(dt.Rows[0]["asm5025no"].ToString().Trim(), out m_mainform.NOEL5025);
                    float.TryParse(dt.Rows[0]["asm2540hc"].ToString().Trim(), out m_mainform.HCEL2540);
                    float.TryParse(dt.Rows[0]["asm2540co"].ToString().Trim(), out m_mainform.COEL2540);
                    float.TryParse(dt.Rows[0]["asm2540no"].ToString().Trim(), out m_mainform.NOEL2540);
                }
            }
            else if (mainform.methodId.Contains("LD") || mainform.methodId.Contains("加载"))//LUG
            {
                //LUG
                string sqlLUG;
                sqlLUG = string.Format(@"Select *  from XZ001_LUG");
                //if (mainform.shphm.Contains("贵"))
                if (true)
                {
                    sqlLUG = string.Format(@"Select *  from XZ001_LUG where lx='A'");
                }
                else
                {
                    sqlLUG = string.Format(@"Select *  from XZ001_LUG where lx='B'");
                }
                DataTable dtLUG = objdb.GetTable(sqlLUG);
                if (dtLUG.Rows.Count > 0)
                {
                    for (int i = 0; i < dtLUG.Rows.Count; i++)
                    {
                        float.TryParse(dtLUG.Rows[i]["pfxz"].ToString().Trim(), out m_mainform.TypeApprovalLimits);
                        float.TryParse(dtLUG.Rows[i]["lugno"].ToString().Trim(), out m_mainform.noxlimit);


                    }
                }
            }
            else if (mainform.methodId.Contains("TG") || mainform.methodId.Contains("自由"))//ZYJS
            {
                //ZYJS
                string sqlZYJS;
                sqlZYJS = string.Format(@"Select *  from XZ001_ZYJS");
                //if (mainform.shphm.Contains("贵"))
                if (true)
                {
                    sqlZYJS = string.Format(@"Select *  from XZ001_ZYJS where lx='A'");
                }
                else
                {
                    sqlZYJS = string.Format(@"Select *  from XZ001_ZYJS where lx='B'");
                }
                DataTable dtZYJS = objdb.GetTable(sqlZYJS);
                if (dtZYJS.Rows.Count > 0)
                {
                    for (int i = 0; i < dtZYJS.Rows.Count; i++)
                    {
                        float.TryParse(dtZYJS.Rows[i]["pfxz"].ToString().Trim(), out m_mainform.InspectionLimits);
                        float.TryParse(dtZYJS.Rows[i]["pfxz"].ToString().Trim(), out m_mainform.TypeApprovalLimits);
                    }
                }
            }
        }//获取限值

        public override DataTable getjilu(string shphm, string sdatestart, string sdateend, bool bbz)//获取登录车辆上线
        {
            getcheliangCS();

            string sql;
            if (shphm == "")
            {
                sql = string.Format(@" select * from SHWD_GetGas where sxsj>'{0}' and sxsj<'{1}' and (jcwc!=1 or jcwc is null)  order by ID desc", sdatestart, sdateend);
            }
            else
            {
                sql = string.Format(@" select * from SHWD_GetGas where sxsj>'{0}' and sxsj<'{1}' and jcCarBrandNumber like '%%{2}%%' and (jcwc!=1 or jcwc is null)  order by ID desc", sdatestart, sdateend, shphm);
            }
            string sfujianqingk = "";
            DataTable dt = objdb.GetTable(sql);
            DataTable dtref = new DataTable();
            dtref.Columns.Add("DETECT_ID");
            dtref.Columns.Add("PLATE_ID");
            dtref.Columns.Add("PCLASS_ID");
            dtref.Columns.Add("jcff");
            dtref.Columns.Add("OBD");
            dtref.Columns.Add("jccs");
            dtref.Columns.Add("zt");
            if (dt.Rows.Count > 0)
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    DataRow dr = dtref.NewRow();
                    dr[0] = dt.Rows[i]["jcCarCheckSerialNumber"].ToString().Trim();    //填充第一列的数据 
                    dr[1] = dt.Rows[i]["jcCarBrandNumber"].ToString().Trim();    //填充第一列的数据 
                    dr[2] = dt.Rows[i]["jcCarBrandTypeNum"].ToString().Trim();    //填充第一列的数据 
                    int icount = 0;
                    int.TryParse(dt.Rows[i]["jcCarCheckDetectionTimes"].ToString().Trim(), out icount);
                    string InspectionMethod = dt.Rows[i]["jcCarCheckMethodNum"].ToString().Trim();
                    string Obdjc = dt.Rows[i]["obd"].ToString().Trim();
                    if (icount < 2)
                    {
                        sfujianqingk = "(初检)";
                    }
                    else
                    {
                        sfujianqingk = "(复检)";
                    }
                    if (InspectionMethod.Contains("1"))
                    {
                        dr[3] = string.Format("双怠速法{0}", sfujianqingk);
                    }
                    else if (InspectionMethod.Contains("5"))
                    {
                        dr[3] = string.Format("自由加速法{0}", sfujianqingk);
                    }
                    else if (InspectionMethod.Contains("2"))
                    {
                        dr[3] = string.Format("ASM工况法{0}", sfujianqingk);
                    }
                    else if (InspectionMethod.Contains("4"))
                    {
                        dr[3] = string.Format("加载减速法{0}", sfujianqingk);
                    }
                    if (Obdjc.Contains("Y"))
                    {
                        dr[4] = "有";
                    }
                    else
                    {
                        dr[4] = "无";
                    }
                    dr[5] = string.Format("{0}", icount);
                    dr[6] = "";
                    dtref.Rows.Add(dr);
                }
            }
            return dtref;
        }

        public void getcheliangCS()//
        {       
            string vehisparajg = "";
            string stoubaojg = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubaojg = stoubaojg + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                         m_mainform.organ,
                                                         m_mainform.jkxlh,
                                                         "GetGas",
                                                         DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));

            vehisparajg = stoubaojg + string.Format(@"<body><vehispara>                   
                                <license>{0}</license>
                                <licensetype>{1}</licensetype>
                                <vin>{2}</vin>
                                <tsno>{3}</tsno>
                                 </vehispara>
			                    </body>
                                </root>",
                                "",
                                "",
                                "",
                                "",
                                m_mainform.organ);

            string sjieguo = Query("GetGas", vehisparajg, mainform.businessId);

            string ses = m_mainform.decode(sjieguo);

            XmlDocument xmlstr = new XmlDocument();
            xmlstr.LoadXml(sjieguo);
            XmlNode xn = xmlstr.SelectSingleNode("/root/body");
            // 得到根节点的所有子节点
            XmlNodeList xnl = xn.ChildNodes;

            foreach (XmlNode xn1 in xnl)
            {

                // 将节点转换为元素，便于得到节点的属性值
                XmlElement xe = (XmlElement)xn1;
                // 得到Type和ISBN两个属性的属性值

                // 得到节点的所有子节点
                XmlNodeList xnl0 = xe.ChildNodes;            
                string jcCarBrandTypeNum = xnl0.Item(0).InnerText;
                string jcCarBrandType = xnl0.Item(1).InnerText;
                string jcCarBrandNumber = xnl0.Item(2).InnerText;
                string jcCarTypeNum = xnl0.Item(3).InnerText;
                string jcCarType = xnl0.Item(4).InnerText;
                string jcCarBrandCorolNum = xnl0.Item(5).InnerText;
                string jcCarBrandCorol = xnl0.Item(6).InnerText;
                string jcCarOwnerName = xnl0.Item(7).InnerText;
                string jcCarMake = xnl0.Item(8).InnerText;
                string jcCarModel = xnl0.Item(9).InnerText;
                string jcCarCheckTypeNum = xnl0.Item(10).InnerText;
                string jcCarCheckType = xnl0.Item(11).InnerText;
                string jcCarOwnerTel = xnl0.Item(12).InnerText;
                string jcCarNatureNum = xnl0.Item(13).InnerText;
                string jcCarNature = xnl0.Item(14).InnerText;
                string jcCarIdentificationNumber = xnl0.Item(15).InnerText;
                string jcCarEngineNumber = xnl0.Item(16).InnerText;
                string jcCarDriveModeNum = xnl0.Item(17).InnerText;
                string jcCarDriveMode = xnl0.Item(18).InnerText;
                string jcCarFuelTypeNum = xnl0.Item(19).InnerText;
                string jcCarFuelType = xnl0.Item(20).InnerText;
                string checkName = xnl0.Item(21).InnerText;
                string jcCarCheckSerialNumber = xnl0.Item(22).InnerText;
                string jcCarCheckDetectionTimes = xnl0.Item(23).InnerText;
                string JcCarCheckMethodNum = xnl0.Item(24).InnerText;
                string JcCarCheckStatus= xnl0.Item(25).InnerText;
                string jcCarCheckMethod = xnl0.Item(26).InnerText;
                string gvm = xnl0.Item(27).InnerText;
                string zbzl = xnl0.Item(28).InnerText;
                string mdate = xnl0.Item(29).InnerText;
                string enginepower = xnl0.Item(30).InnerText;
                string enginespeed = xnl0.Item(31).InnerText;
                string obd = xnl0.Item(32).InnerText;
                string odometer = xnl0.Item(33).InnerText;
                string JcCarFuelCategory = xnl0.Item(34).InnerText;


                //存储下载的车辆信息
                string sqlxzxx = "";
                sqlxzxx = string.Format(@"select * from SHWD_GetGas where jcCarCheckSerialNumber='{0}' and jcCarCheckDetectionTimes='{1}' order by ID desc ",
                                                                         jcCarCheckSerialNumber, jcCarCheckDetectionTimes);

                if (m_mainform.objbass.objdb.selectDBcount(sqlxzxx) < 1)
                {
                    sqlxzxx = string.Format(@"insert into SHWD_GetGas (
                                                    jcCarBrandTypeNum,
                                                    jcCarBrandType,
                                                    jcCarBrandNumber,
                                                    jcCarTypeNum,
                                                    jcCarType,
                                                    jcCarBrandCorolNum,
                                                    jcCarBrandCorol,
                                                    jcCarOwnerName,
                                                    jcCarMake,
                                                    jcCarModel,
                                                    jcCarCheckTypeNum,
                                                    jcCarCheckType,
                                                    jcCarOwnerTel,
                                                    jcCarNatureNum,
                                                    jcCarNature,
                                                    jcCarIdentificationNumber,
                                                    jcCarEngineNumber,
                                                    jcCarDriveModeNum,
                                                    jcCarDriveMode,
                                                    jcCarFuelTypeNum,
                                                    jcCarFuelType,
                                                    checkName,
                                                    jcCarCheckSerialNumber,
                                                    jcCarCheckDetectionTimes,
                                                    JcCarCheckMethodNum,
                                                    JcCarCheckStatus,
                                                    jcCarCheckMethod,
                                                    gvm,
                                                    zbzl,
                                                    mdate,
                                                    enginepower,
                                                    enginespeed,
                                                    obd,
                                                    odometer,
                                                    sxsj,
                                                    JcCarFuelCategory) values 
                                                   ('{0}',
                                                    '{1}',
                                                    '{2}',
                                                    '{3}',
                                                    '{4}',
                                                    '{5}',
                                                    '{6}',
                                                    '{7}',
                                                    '{8}',
                                                    '{9}',
                                                    '{10}',
                                                    '{11}',
                                                    '{12}',
                                                    '{13}',
                                                    '{14}',
                                                    '{15}',
                                                    '{16}',
                                                    '{17}',
                                                    '{18}',
                                                    '{19}',
                                                    '{20}',
                                                    '{21}',
                                                    '{22}',
                                                    '{23}',
                                                    '{24}',
                                                    '{25}',
                                                    '{26}',
                                                    '{27}',
                                                    '{28}',
                                                    '{29}',
                                                    '{30}',
                                                    '{31}',
                                                    '{32}',
                                                    '{33}',
                                                    '{34}',
                                                    '{35}')",
                                                   jcCarBrandTypeNum,
                                                    jcCarBrandType,
                                                    jcCarBrandNumber,
                                                    jcCarTypeNum,
                                                    jcCarType,
                                                    jcCarBrandCorolNum,
                                                    jcCarBrandCorol,
                                                    jcCarOwnerName,
                                                    jcCarMake,
                                                    jcCarModel,
                                                    jcCarCheckTypeNum,
                                                    jcCarCheckType,
                                                    jcCarOwnerTel,
                                                    jcCarNatureNum,
                                                    jcCarNature,
                                                    jcCarIdentificationNumber,
                                                    jcCarEngineNumber,
                                                    jcCarDriveModeNum,
                                                    jcCarDriveMode,
                                                    jcCarFuelTypeNum,
                                                    jcCarFuelType,
                                                    checkName,
                                                    jcCarCheckSerialNumber,
                                                    jcCarCheckDetectionTimes,
                                                    JcCarCheckMethodNum,
                                                    JcCarCheckStatus,
                                                    jcCarCheckMethod,
                                                    gvm,
                                                    zbzl,
                                                    mdate,
                                                    enginepower,
                                                    enginespeed,
                                                    obd,
                                                    odometer,
                                                    DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                                                    JcCarFuelCategory);
                }
                else
                {
                    sqlxzxx = string.Format(@"update  SHWD_GetGas set 
                                                    jcCarBrandTypeNum='{0}',
                                                    jcCarBrandType='{1}',
                                                    jcCarBrandNumber='{2}',
                                                    jcCarTypeNum='{3}',
                                                    jcCarType='{4}',
                                                    jcCarBrandCorolNum='{5}',
                                                    jcCarBrandCorol='{6}',
                                                    jcCarOwnerName='{7}',
                                                    jcCarMake='{8}',
                                                    jcCarModel='{9}',
                                                    jcCarCheckTypeNum='{10}',
                                                    jcCarCheckType='{11}',
                                                    jcCarOwnerTel='{12}',
                                                    jcCarNatureNum='{13}',
                                                    jcCarNature='{14}',
                                                    jcCarIdentificationNumber='{15}',
                                                    jcCarEngineNumber='{16}',
                                                    jcCarDriveModeNum='{17}',
                                                    jcCarDriveMode='{18}',
                                                    jcCarFuelTypeNum='{19}',
                                                    jcCarFuelType='{20}',
                                                    checkName='{21}',
                                                    JcCarCheckMethodNum='{22}',
                                                    JcCarCheckStatus='{23}',
                                                    jcCarCheckMethod='{24}',
                                                    gvm='{25}',
                                                    zbzl='{26}',
                                                    mdate='{27}',
                                                    enginepower='{28}',
                                                    enginespeed='{29}',
                                                    obd='{30}',
                                                    odometer='{31}',
                                                    JcCarFuelCategory='{32}',
                                                    jcwc='0'
                                              where jcCarCheckSerialNumber='{33}' and  jcCarCheckDetectionTimes='{34}'",
                                                    jcCarBrandTypeNum,
                                                    jcCarBrandType,
                                                    jcCarBrandNumber,
                                                    jcCarTypeNum,
                                                    jcCarType,
                                                    jcCarBrandCorolNum,
                                                    jcCarBrandCorol,
                                                    jcCarOwnerName,
                                                    jcCarMake,
                                                    jcCarModel,
                                                    jcCarCheckTypeNum,
                                                    jcCarCheckType,
                                                    jcCarOwnerTel,
                                                    jcCarNatureNum,
                                                    jcCarNature,
                                                    jcCarIdentificationNumber,
                                                    jcCarEngineNumber,
                                                    jcCarDriveModeNum,
                                                    jcCarDriveMode,
                                                    jcCarFuelTypeNum,
                                                    jcCarFuelType,
                                                    checkName,
                                                    JcCarCheckMethodNum,
                                                    JcCarCheckStatus,
                                                    jcCarCheckMethod,
                                                    gvm,
                                                    zbzl,
                                                    mdate,
                                                    enginepower,
                                                    enginespeed,
                                                    obd,
                                                    odometer,
                                                    JcCarFuelCategory,
                                                    jcCarCheckSerialNumber,
                                                    jcCarCheckDetectionTimes);

                }

                m_mainform.objbass.objdb.InsertDB(sqlxzxx);
                //baocunCLXX(jcCarCheckSerialNumber, jcCarCheckDetectionTimes, enginepower, enginespeed, gvm, jcCarType);
                string ssql = string.Format("select * from Detects_SJE where ASM_JYLSH='{0}' and ITERAT={1}", jcCarCheckSerialNumber, jcCarCheckDetectionTimes);//更新本地
                if (m_mainform.objbass.objdb.selectDBcount(ssql) < 1)
                {
                    ssql = string.Format(@"insert into Detects_SJE (PLATE_ID,PCLASS_ID,ITERAT,ASM_JYLSH) values ('{0}','{1}',{2},'{3}')",
                                          jcCarBrandNumber, jcCarBrandTypeNum, jcCarCheckDetectionTimes, jcCarCheckSerialNumber);
                    m_mainform.objbass.objdb.InsertDB(ssql);
                }
                else
                {
                    ssql = string.Format("update Detects_SJE set ITERAT='{0}',ASM_JYLSH='{1}' where PLATE_ID='{2}'and PCLASS_ID='{3}' ", jcCarCheckDetectionTimes, jcCarCheckSerialNumber, jcCarBrandNumber, jcCarBrandTypeNum);
                    m_mainform.objbass.objdb.InsertDB(ssql);
                }
            }
        }

        public override void zhuapai(string sjylsh, string hphm, string hpzl, string stongdao, string gongwei,string xuhao)
        {
            string ssql = "";
            if (stongdao.Length>0)
            {
                //string ssql="";
                string sql = string.Format(@"Select * From xianneizhaopian where jylsh='{0}' and tongdao='{1}' and gongwei='{2}' and xuhao='{3}'", sjylsh, stongdao, gongwei,xuhao);
                DataTable dt = m_mainform.objdbbass.GetTable(sql);
                if (dt.Rows.Count > 0)
                {
                    ssql = string.Format(@"update xianneizhaopian set 
                        jyjgbh='{0}',
                        hphm='{1}',
                        hpzl='{2}',
                        tongdao='{3}',
                        gongwei='{4}',
                        xuhao='{5}',
                        wancheng='{6}'
                        where  jylsh='{7}' and tongdao='{8}' and gongwei='{9}' and xuhao='{10}'",
                   m_mainform.sjcz,
                   hphm,
                   hpzl,
                   stongdao,
                   gongwei,
                   xuhao,
                   "否",
                   sjylsh,
                   stongdao,
                   gongwei,
                   xuhao);
                }
                else
                {
                     ssql = string.Format(@"insert into xianneizhaopian (
                                               jylsh,
                                                jyjgbh,
                                                hphm,
                                                hpzl,
                                                tongdao,
                                                gongwei,
                                                xuhao,
                                                wancheng) values ('{0}',
                                                '{1}',
                                                '{2}',
                                                '{3}',
                                                '{4}',
                                                '{5}',
                                                '{6}',
                                                '{7}')",
                                               sjylsh,
                                               m_mainform.organ,
                                               hphm,
                                               hpzl,
                                               stongdao,
                                               gongwei,
                                               xuhao,
                                               "否");
                }
                Write("线内抓拍", ssql, sjylsh);
                m_mainform.objbass.objdb.InsertDB(ssql);
            }
           
        }

        public override void luxiangkaishi(string sjylsh, string hphm, string hpzl, string stongdao, string gongwei)
        {
            if (stongdao.Length>0)
            {
                string ssql = string.Format(@"select * from luxiangkaishi where jylsh='{0}' and gongwei='{1}' and jycs='{2}' ", sjylsh, gongwei, m_mainform.testtimes);
                if (m_mainform.objbass.objdb.selectDBcount(ssql) < 1)
                {
                    ssql = string.Format(@"insert into luxiangkaishi(jylsh,
                                                            jyjgbh,
                                                            hphm,
                                                            hpzl,
                                                            tongdao,
                                                            gongwei,
                                                            xuhao,
                                                            wancheng,
                                                            lxlj,
                                                            lxzm,
                                                            jycs,
                                                            kssj) values(
                                                            '{0}',
                                                            '{1}',
                                                            '{2}',
                                                            '{3}',
                                                            '{4}',
                                                            '{5}',
                                                            '{6}',
                                                            '{7}',
                                                            '{8}',
                                                            '{9}',
                                                            '{10}',
                                                            '{11}')",
                                                                sjylsh,
                                                                m_mainform.organ,
                                                                hphm,
                                                                hpzl,
                                                                stongdao,
                                                                gongwei,
                                                                gongwei,
                                                                "否",
                                                                "",
                                                                "",
                                                                m_mainform.testtimes,
                                                                DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                }
                else
                {
                    ssql = string.Format(@"update  luxiangkaishi set jyjgbh='{0}',
                                                                 hphm='{1}',
                                                                 hpzl='{2}',
                                                                 tongdao='{3}',
                                                                 wancheng='{5}',
                                                                 xuhao='{6}',
                                                                 lxlj='{7}',
                                                                 lxljsc='',
                                                                 lxzm='{8}',
                                                                 kssj ='{11}'where jylsh='{10}' and gongwei='{4}' and jycs='{9}'",
                                                                     m_mainform.organ,
                                                                     hphm,
                                                                     hpzl,
                                                                     stongdao,
                                                                     gongwei,
                                                                     "否",
                                                                     gongwei,
                                                                     "",
                                                                     "",
                                                                     m_mainform.testtimes,
                                                                     sjylsh,
                                                                     DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                }
                m_mainform.objbass.objdb.InsertDB(ssql);
            }
        }

        public override void luxiangjieshu(string sjylsh, string stongdao, string gongwei)
        {
            if (stongdao.Length>0)
            {
                string ssql = string.Format(@"select * from luxiangjieshu where jylsh='{0}' and gongwei='{1}' and jycs='{2}' ", sjylsh, gongwei, m_mainform.testtimes);
                if (m_mainform.objbass.objdb.selectDBcount(ssql) < 1)
                {
                    ssql = string.Format(@"insert into luxiangjieshu (
                                                jylsh,
                                                jyjgbh,
                                                hphm,
                                                hpzl,
                                                tongdao,
                                                gongwei,
                                                xuhao,
                                                wancheng,
                                                jycs,
                                                jssj) values ('{0}',
                                                '{1}',
                                                '{2}',
                                                '{3}',
                                                '{4}',
                                                '{5}',
                                                '{6}',
                                                '{7}',
                                                '{8}',
                                                '{9}')",
                                                        sjylsh,
                                                        m_mainform.organ,
                                                        "",
                                                        "",
                                                        stongdao,
                                                        gongwei,
                                                        "",
                                                        "否",
                                                         m_mainform.testtimes,
                                                         DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                }
                else
                {
                    string sql = string.Format(@"update luxiangjieshu set jyjgbh='{0}',
                                                                      hphm='{1}',
                                                                      hpzl='{2}',
                                                                      tongdao='{3}',
                                                                      jssj='{4}'
                                                                      wancheng='{5}'where jylsh='{6}' and gongwei='{7}' and jycs='{8}'",
                                                                          m_mainform.organ,
                                                                          "",
                                                                          "",
                                                                          stongdao,
                                                                          DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                                                                          '否',
                                                                          sjylsh,
                                                                          gongwei,
                                                                          m_mainform.testtimes);



                }
                m_mainform.objbass.objdb.InsertDB(ssql);
            }
        }

        public override string SendMessage(string code, string message)
        {
            return "";//暂时不开放

            var result = "";
            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                           m_mainform.jkxlh,
                                                           "SendMessage",
                                                           DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            vehispara = stoubao + string.Format(@"<body><vehispara>                   
                                <businessId>{0}</businessId>
                                <registCode>{1}</registCode>
                                <code>{2}</code>
                                <message>{3}</message>      
                                 </vehispara>
			                    </body>
                                </root>",
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode,
                                code,
                                encode(message));

            result = Write("SendMessage", vehispara, mainform.businessId);
            return result;
        }//发送消息通知接口 //暂时不开放

        public override string GetState()
        {
            var result = "";//暂时不开放
            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                          m_mainform.jkxlh,
                                                           "GetState",
                                                           DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            vehispara = stoubao + string.Format(@"<body><vehispara>                   
                                <registCode>{0}</registCode>
                                 </vehispara>
			                    </body>
                                </root>",
                                mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode);


            result = Query("GetState", vehispara, mainform.businessId);

            return result;
        }//取检测状态信息接口 //暂时不开放

        public override string GetCarInfo()//获取待检车辆信息接口
        {
            var result = "";
            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                           m_mainform.jkxlh,
                                                           "GetCarInfo",
                                                           DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            vehispara = stoubao + string.Format(@"<body><vehispara>                   
                                <businessId>{0}</businessId>
                                <registCode>{1}</registCode>
                                </vehispara>
			                    </body>
                                </root>",
                                 mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                 mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode);


            result = Query("GetCarInfo", vehispara, mainform.businessId);

            return result;
        } //暂时不开放

        public override string GetObd()
        {
            var result = "";
            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                           m_mainform.jkxlh,
                                                           "GetObd",
                                                           DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            vehispara = stoubao + string.Format(@"<body><vehispara>                   
                                <license>{0}</license>
                                <licensetype>{1}</licensetype>
                                <vin>{2}</vin>
                                <tsno>{3}</tsno>
                                </vehispara>
			                    </body>
                                </root>",
                                "",
                                "",
                                "",
                                m_mainform.organ);

            result = Query("GetObd", vehispara, mainform.businessId);
            return result;
        }//OBD待检列表

        public override string GetGas()
        {
            var result = "";
            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                           m_mainform.jkxlh,
                                                           "GetGas",
                                                           DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            vehispara = stoubao + string.Format(@"<body><vehispara>                   
                                <registCode>{0}</registCode>
                                <license>{1}</license>
                                <licensetype>{2}</licensetype>
                                <vin>{3}</vin>
                                <tsno>{4}</tsno>
                                 </vehispara>
			                    </body>
                                </root>",
                                mainform.registCode,
                                "",
                                "",
                                "",
                                "");
            result = Query("GetGas", vehispara, mainform.businessId);
            return result;
        }//尾气待检列表

        public override string GetWJ001()
        {
            var result = "";
            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                          m_mainform.jkxlh,
                                                           "GetWJ001",
                                                           DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            vehispara = stoubao + string.Format(@"<body><vehispara>                   
                                <license>{0}</license>
                                <licensetype>{1}</licensetype>
                                <vin>{2}</vin>
                                <tsno>{3}</tsno>
                                 </vehispara>
			                    </body>
                                </root>",
                                "",
                                "",
                                "",
                                m_mainform.organ);
            result = Query("GetWJ001", vehispara, mainform.businessId);

            XmlDocument xmlstr = new XmlDocument();
            xmlstr.LoadXml(result);

            XmlNode xn = xmlstr.SelectSingleNode("/root/head");
            //// 得到根节点的所有子节点
            XmlNodeList xnl = xn.ChildNodes;

            foreach (XmlNode xn1 in xnl)
            {
                // 将节点转换为元素，便于得到节点的属性值
                XmlElement xe = (XmlElement)xn1;
                // 得到Type和ISBN两个属性的属性值

                // 得到节点的所有子节点
                XmlNodeList xnl0 = xe.ChildNodes;
                string a = xnl0.Item(0).InnerText;
                //string c = xnl0.Item(2).InnerText;
            }
            return result;
        }//获取外检

        public override void XZ001()//检测限值信息
        {
           string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>  
                                                            <vehispara>  
                                                            </vehispara> </root>",
                                                           m_mainform.organ,
                                                           m_mainform.jkxlh,
                                                           "GetWJ001",
                                                           DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));

            string sjieguo = (Query("XZ001", vehispara, mainform.businessId));

            XmlDocument xmlstr = new XmlDocument();
            xmlstr.LoadXml(sjieguo);
            if (xmlstr.SelectSingleNode("/root/head/code").InnerText == "1")
            {
                //返回限值信息;
            }

        }

        public override void gettime()
        {

            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            vehispara = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>
                                                <vehispara>  
                                                </vehispara></root>",
                                                m_mainform.organ,
                                                m_mainform.jkxlh,
                                                "SJ001",
                                                DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            string sjieguo = (Query("SJ001",vehispara,"请求时间接口"));
            XmlDocument xmlstr = new XmlDocument();
            xmlstr.LoadXml(sjieguo);
            if (xmlstr.SelectSingleNode("/root/head/code").InnerText == "1")
            {
                string syndate = m_mainform.decode(xmlstr.SelectSingleNode("/root/body/vehispara/syndate").InnerText);//时间同行
                DateTime dt = DateTime.Parse(syndate.Substring(0, syndate.Length - 4));
                // 创建SystemTime结构体，用于接收用户设置的时间   
                mainform.SystemTime systemTime = new mainform.SystemTime();
                // 从setDate,setTime控件中获取年，月，日，小时，分钟，秒信息，存入SystemTime结构体中       
                systemTime.wYear = (ushort)dt.Year;
                systemTime.wMonth = (ushort)dt.Month;
                systemTime.wDay = (ushort)dt.Day;
                systemTime.wHour = (ushort)dt.Hour;
                systemTime.wMinute = (ushort)dt.Minute;
                systemTime.wSecond = (ushort)dt.Second;
                // 将系统的时间设置为用户指定的时间   
                mainform.SetLocalTime(ref systemTime);
                //MessageBox.Show(syndate);
            }
        }//时间同步

        public override string WJ001()
        {
            var result = "";
            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                           m_mainform.jkxlh,
                                                           "WJ001",
                                                           DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            vehispara = stoubao + string.Format(@"<body><vehispara>                   
                                                <jylsh>{0}</jylsh>
                                                <registCode>{1}</registCode>
                                                <businessId>{2}</businessId>
                                                <testtimes>{3}</testtimes>
                                                <tsno>{4}</tsno>
                                                <jyksrq>{5}</jyksrq>
                                                <jyjsrq>{6}</jyjsrq>
                                                <jyy>{7}</jyy>
                                                <jyjg>{8}</jyjg>
                                                <sfmj>{9}</sfmj>
                                                <odometer>{10}</odometer>
                                                <jxzk>{11}</jxzk>
                                                <pwkz>{12}</pwkz>
                                                <hy>{13}</hy>
                                                <tfxt>{14}</tfxt>
                                                <tg>{15}</tg>
                                                <yb>{16}</yb>
                                                <jxgz>{17}</jxgz>
                                                <pqxl>{18}</pqxl>
                                                <ly>{19}</ly>
                                                <obd>{20}</obd>
                                                <ltqy>{21}</ltqy>
                                                <ltsfgzqj>{22}</ltsfgzqj>
                                                <fszz>{23}</fszz>
                                                <tszz>{24}</tszz>
                                                <ry>{25}</ry>
                                                <gkjc>{26}</gkjc>
                                                <dkb>{27}</dkb>
                                                 </vehispara>
			                                    </body>
                                                </root>",

                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode,
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                m_mainform.testtimes,
                                m_mainform.organ,
                                DateTime.Now.AddMinutes(-5).ToString("yyyy-MM-dd HH:mm:ss"),
                                DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                                m_mainform.sczyxx.Length < 1 ? "蒋佩" : m_mainform.sczyxx,
                                "1",
                                "N",
                                "888",
                                "Y",
                                "Y",
                                "N",
                                "Y",
                                "Y",
                                "Y",
                                "N",
                                "N",
                                "N",
                                "Y",//obd
                                "Y",
                                "Y",
                                "Y",
                                "Y",
                                "N",
                                "N",//适合工况
                                "N");

            result = Write("WJ001", vehispara, mainform.businessId);


            return result;

        }//获取外检

        public override string BgAirHC()
        {
            return "";//暂时不开放

            var result = "";
            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                           m_mainform.jkxlh,
                                                           "BgAirHC",
                                                           DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            vehispara = stoubao + string.Format(@"<body><vehispara>                   
                                <businessId>{0}</businessId>
                                <registCode>{1}</registCode>
                                <bgCO>{2}</bgCO>
                                <bgNO>{3}</bgNO>
                                <bgHC>{4}</bgHC>
                                <canliuHC>{5}</canliuHC>
                                <lFlowResult>{6}</lFlowResult> 
                                <o2Avg>{7}</o2Avg>
                                <checkResult>{8}</checkResult>
                                <checkTimeStart>{9}</checkTimeStart>
                                <checkTimeEnd>{10}</checkTimeEnd>
                                <remark>{11}</remark>
                                 </vehispara>
			                    </body>
                                </root>",
                                 mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                 mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode,
                                 "0",
                                 "0",
                                 "0",
                                 "0",
                                 "1",
                                 "1",
                                 "0",
                                  DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                                  DateTime.Now.AddSeconds(15).ToString("yyyy-MM-dd HH:mm:ss"),
                                  "");
            WebReferenceZHHB.WSServiceImplService m_vesd = new WebReferenceZHHB.WSServiceImplService();
            m_vesd.Url = m_mainform.surl;

            result = Write("BgAirHC", vehispara, mainform.businessId);
            return result;
        }//HC上传//暂时不开放

        public override string OBD001()//OBD开始检测
        {
            //if (mainform.obdzt.Contains("否"))
            //{
            //    return "";
            //}
            var result = "";
            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                           m_mainform.jkxlh,
                                                           "OBD001",
                                                           DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            vehispara = stoubao + string.Format(@"<body><vehispara>                   
                                <jylsh>{0}</jylsh>
                                <testtimes>{1}</testtimes>
                                <businessId>{2}</businessId>
                                <registCode>{3}</registCode>
                                 </vehispara>
			                    </body>
                                </root>",
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                m_mainform.testtimes,
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode);

            result = Write("OBD001", vehispara, mainform.businessId);
            sendOBD(mainform.businessId,true);//测试fwj
            return result;
        }

        public override string JC011()//OBD检测结果
        {
            string jyksrq = "";
            string jyjsrq = "";
            string jyy = "";
            string jyjg = "";
            string obdzdyscqy = "";
            string obdzdyxh = "";
            string vin = "";
            string obdyq = "";
            string gzjg = "";
            string tx = "";
            string txbz = "";
            string bj = "";
            string bjbz = "";
            string jxxm = "";
            string jxxmbz = "";
            string odometer = "";
            string odomil = "";
            string enginecalid = "";
            string enginecvn = "";
            string hclcalid = "";
            string hclcvn = "";
            string calid = "";
            string cvn = "";
            string iupr = "";
            string gzm;
            string sql = string.Format(@"select * from OBD_JCJG  where jylsh ='{0}'  order by OBD_JCJG_ID desc", mainform.businessId.Length < 1 ? "1" : mainform.businessId);// DateTime.Now.AddDays(-30), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));

            DataTable dt = objdb.GetTable(sql);
            if (dt.Rows.Count > 0)
            {

                jyksrq = dt.Rows[0]["OBD_JCJG_date"].ToString().Trim();
                jyjsrq = dt.Rows[0]["OBD_JCJG_date"].ToString().Trim();

                jyy = m_mainform.InspectionOperator;
                jyjg = "1";
                obdzdyscqy = m_mainform.OBDqiye;
                obdzdyxh = m_mainform.OBDname;

                string[] obdvin = dt.Rows[0]["OBD_JCJG_CLXX1"].ToString().Trim().Split(',');//发动机控制单元 CAL ID
                if (obdvin[0] != "")
                {
                    vin = obdvin[1];
                }
                else
                {
                    vin = "";
                }
                obdyq = "EOBD";
                gzjg = "1";
                bj = "1";
                bjbz = "";
                gzm = "";
                //if (m_mainform.obdsc.Contains("否"))
                {
                    for (int i = 0; i < 7; i++)
                    {

                        if (dt.Rows[0][string.Format("OBD_JCJG_GZM{0}", i + 1)].ToString().Trim().Length > 0)
                        {
                            gzm = dt.Rows[0][string.Format("OBD_JCJG_GZM{0}", i + 1)].ToString().Trim();
                            if (bjbz.Length < 1)
                            {
                                bjbz = dt.Rows[0][string.Format("OBD_JCJG_GZM{0}", i + 1)].ToString().Trim();

                                if (gzm.Contains("P1683") || gzm.Contains("P0538") || gzm.Contains("P0481") || gzm.Contains("P0645") || gzm.Contains("预留") || gzm.Contains("null"))
                                {
                                    bjbz = "";
                                }
                            }
                            else
                            {
                                if (gzm.Contains("P1683") || gzm.Contains("P0538") || gzm.Contains("P0481") || gzm.Contains("P0645") || gzm.Contains("预留") || gzm.Contains("null"))
                                {
                                    bjbz = bjbz + "";
                                }
                                else
                                {
                                    bjbz = bjbz + dt.Rows[0][string.Format("OBD_JCJG_GZM{0}", i + 1)].ToString().Trim();
                                }

                            }
                        }


                    }
                    if (bjbz.Length > 0)
                    {
                        // bjbz = "";
                        gzjg = "0";
                        bj = "0";
                        jyjg = "0";
                    }
                }


                tx = "1";
                txbz = "";
                jxxm = "1";
                jxxmbz = "";

                //if (m_mainform.obdsc.Contains("否"))
                {
                    for (int i = 0; i < 10; i++)
                    {
                        int y = 0;
                        if (dt.Rows[0][string.Format("OBD_JCJG_JXZT{0}", i + 1)].ToString().Trim().Contains("未完成"))
                        {
                            jxxm = "0";


                            if (bjbz.Length < 1)
                            {
                                jxxmbz = dt.Rows[0][string.Format("OBD_JCJG_JXZT{0}", i + 1)].ToString().Trim();
                            }
                            else
                            {
                                jxxmbz = bjbz + dt.Rows[0][string.Format("OBD_JCJG_JXZT{0}", i + 1)].ToString().Trim();
                            }
                            y++;
                        }
                        if (y > 2)
                        {
                            jyjg = "0";
                        }

                    }
                }
                for (int i = 0; i < 12; i++)
                {


                    if (dt.Rows[0][string.Format("OBD_JCJG_SJL{0}", i + 1)].ToString().Trim().Contains("里程表"))
                    {

                        string[] obdlc = dt.Rows[0][string.Format("OBD_JCJG_SJL{0}", i + 1)].ToString().Trim().Split(',');
                        if (obdlc[0] != "")
                        {
                            odometer = obdlc[1];
                        }
                        else
                        {
                            odometer = "";
                        }




                    }
                    if (dt.Rows[0][string.Format("OBD_JCJG_SJL{0}", i + 1)].ToString().Trim().Contains("点亮后的行驶距离"))
                    {



                        string[] obdlc = dt.Rows[0][string.Format("OBD_JCJG_SJL{0}", i + 1)].ToString().Trim().Split(',');
                        if (obdlc[0] != "")
                        {
                            odomil = obdlc[1];
                        }
                        else
                        {
                            odomil = "";
                        }
                    }
                }

                string[] obdcalid1 = dt.Rows[0]["OBD_JCJG_CLXX2"].ToString().Trim().Split(',');//发动机控制单元 CAL ID
                if (obdcalid1[0] != "")
                {
                    enginecalid = obdcalid1[1];
                }
                else
                {
                    enginecalid = "";
                }

                string[] obdvin1 = dt.Rows[0]["OBD_JCJG_CLXX3"].ToString().Trim().Split(',');//发动机控制单元 CVN
                if (obdvin1[0] != "")
                {
                    enginecvn = obdvin1[1];
                }
                else
                {
                    enginecvn = "";
                }

                hclcalid = "";
                hclcvn = "";

                if (dt.Rows[0]["OBD_JCJG_CLXX4"].ToString().Trim().Contains("CALID"))//其他发动机控制单元 CAL ID
                {
                    string[] obdcalid2 = dt.Rows[0]["OBD_JCJG_CLXX4"].ToString().Trim().Split(',');
                    if (obdcalid2[0] != "")
                    {
                        calid = obdcalid2[1];
                    }
                    else
                    {
                        calid = "";
                    }
                }
                else
                {
                    calid = "";
                }

                if (dt.Rows[0]["OBD_JCJG_CLXX5"].ToString().Trim().Contains("CVN"))//其他发动机控制单元 CAL ID
                {
                    string[] obdvin2 = dt.Rows[0]["OBD_JCJG_CLXX5"].ToString().Trim().Split(',');
                    if (obdvin2[0] != "")
                    {
                        cvn = obdvin2[1];
                    }
                    else
                    {
                        cvn = "";
                    }
                }
                else
                {
                    cvn = "";
                }


                for (int i = 0; i < 34; i++)
                {
                    if (dt.Rows[0][string.Format("OBD_JCJG_IUPR{0}", i + 1)].ToString().Trim().Length > 0)
                    {

                        //格式化iupr
                    }

                }

                ///
            }

            var result = "";
            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                           m_mainform.jkxlh,
                                                           "JC011",
                                                           DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            vehispara = stoubao + string.Format(@"<body><vehispara>                   
                               <jylsh>{0}</jylsh>
                                <registCode>{1}</registCode>
                                <businessId>{2}</businessId>
                                <testtimes>{3}</testtimes>
                                <jyksrq>{4}</jyksrq>
                                <jyjsrq>{5}</jyjsrq>
                                <jyy>{6}</jyy>
                                <jyjg>{7}</jyjg>
                                <obdzdyscqy>{8}</obdzdyscqy>
                                <obdzdyxh>{9}</obdzdyxh>
                                <vin>{10}</vin>
                                <obdyq>{11}</obdyq>
                                <gzjg>{12}</gzjg>
                                <tx>{13}</tx>
                                <txbz>{14}</txbz>
                                <bj>{15}</bj>
                                <bjbz>{16}</bjbz>
                                <jxxm>{17}</jxxm>
                                <jxxmbz>{18}</jxxmbz>
                                <odometer>{19}</odometer>
                                <odomil>{20}</odomil>
                                <enginecalid>{21}</enginecalid>
                                <enginecvn>{22}</enginecvn>
                                <hclcalid>{23}</hclcalid>
                                <hclcvn>{24}</hclcvn>
                                <calid>{25}</calid>
                                <cvn>{26}</cvn>
                                <iupr>{27}</iupr>
                                </vehispara>
			                    </body>
                                </root>",
                               mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                               mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode,
                               mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                               m_mainform.testtimes,
                               DateTime.Now.AddSeconds(-30),// jyksrq,
                               DateTime.Now,//jyjsrq,
                               m_mainform.InspectionOperator,
                                jyjg,
                               obdzdyscqy,
                               obdzdyxh,
                               "VIN",
                               obdyq,
                               gzjg,
                               tx,
                               txbz,
                               bj,
                               bjbz,
                               jxxm,
                               jxxmbz,
                               "888",
                               "888",
                               enginecalid,
                               enginecvn,
                               hclcalid,
                               hclcvn,
                               calid,
                               cvn,
                               iupr);
            result = Write("JC011", vehispara, mainform.businessId);

            return result;
        }

        public override string WQ001()//尾气开始检测
        {
            var result = "";
            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                           m_mainform.jkxlh,
                                                           "WQ001",
                                                           DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            vehispara = stoubao + string.Format(@"<body><vehispara>                   
                                <jylsh>{0}</jylsh>
                                <testtimes>{1}</testtimes>
                                <businessId>{2}</businessId>
                                <registCode>{3}</registCode>
                                <testlineno>{4}</testlineno>
                                <jcjsy>{5}</jcjsy>
                                <jcczy>{6}</jcczy>
                                <zlkzy>{7}</zlkzy>
                                <sqr>{8}</sqr>
                                <testtype>{9}</testtype>
                                <odometer>{10}</odometer>
                                <dqsj>{11}</dqsj>
                                <jcbbh>{12}</jcbbh>
                                 </vehispara>
			                    </body>
                                </root>",
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                m_mainform.testtimes,
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode,
                                m_mainform.lineCode,
                                m_mainform.InspectionDriver,//引车员
                                m_mainform.InspectionOperator,//操作员
                                m_mainform.zhiliangkzy,
                                m_mainform.neishenyuan,
                                m_mainform.jcffdh.Trim(),
                                m_mainform.odometer,
                                DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                                "V2.1");

            result = Write("WQ001", vehispara, mainform.businessId);
            return result;
        }

        public override string GetPic(string zpbh)
        {
//            if (zpbh=="21"||zpbh=="22"||zpbh=="23"||zpbh=="24"||zpbh=="41"||zpbh=="43"||zpbh=="11"||zpbh=="12"||zpbh=="13"||zpbh=="51"||zpbh=="52"||zpbh=="53")
//            {
//                return "";
//            }
//            string zplj = "";
//            string sql = string.Format(@"select * from zhaopian where jylsh ='{0}'  ", mainform.businessId);
//            DataTable dt = m_mainform.objbass.objdb.GetTable(sql);
//            if (dt.Rows.Count > 0)
//            {
//                zplj = dt.Rows[0]["zp0" + zpbh].ToString().Trim();
//            }
//            string lj = zplj.Replace(m_mainform.wjlj, m_mainform.wjljxn).Replace("xml", "jpg").Replace(@"\", @"/");//平台路劲
//            var result = "";
//            string vehispara = "";
//            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
//            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
//                                                           m_mainform.organ,
//                                                          m_mainform.jkxlh,
//                                                           "ZP002",
//                                                           DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
//            vehispara = stoubao + string.Format(@"<body><vehispara>
//                                <jylsh>{0}</jylsh>
//                                <businessId>{1}</businessId>
//                                <registCode>{2}</registCode>
//                                <testtimes>{3}</testtimes>
//                                <tsno>{4}</tsno>
//                                <testlineno>{5}</testlineno>
//                                <zpbh>{6}</zpbh>
//			                    <photo_date>{7}</photo_date>
//                                <photo_url>{8}</photo_url>
//                                 </vehispara>
//			                    </body>
//                                </root>",
//                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
//                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
//                                mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode,
//                                m_mainform.testtimes,
//                                m_mainform.organ,
//                                m_mainform.lineCode,
//                                zpbh,
//                                DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
//                                lj);//"https://i.loli.net/2020/05/09/ZsGmNiFyOjPeAhQ.jpg");

//            result = Write("GetPic" + zpbh, vehispara, mainform.businessId);
//            return result;
            return "";
        }//抓拍长沙智慧平台不使用，改成检验结束才发照片 对应函数GetPIC

        public override string LuXiang(string lxbh ,string lxlj)
        {
            string lxdx = "0";
            string slxbh = lxbh;
            if (lxbh.Contains("01"))
            {
                lxbh = "wqq";
            }
            else if (lxbh.Contains("02"))
            {
                lxbh = "wqh";
            }
            else if (lxbh.Contains("03"))
            {
                lxbh = "wqqj";
            }
            string sql = string.Format(@"select * from luxiangkaishi where jylsh ='{0}' and jycs='{1}' and gongwei='{2}'", mainform.businessId, m_mainform.testtimes, lxbh);
            DataTable dt = m_mainform.objbass.objdb.GetTable(sql);
            if (dt.Rows.Count > 0)
            {
                lxlj = dt.Rows[0]["lxljsc"].ToString().Trim();

                long lSize = 0;
                string m_strSize = "0";
                if (File.Exists(lxlj))
                {
                    lSize = new FileInfo(lxlj).Length;
                    m_strSize = (lSize / 1024.00).ToString("0") + " K";
                }
                lxdx = m_strSize;
                string lj = lxlj.Replace(m_mainform.wjlj, m_mainform.wjljxn).Replace(@"\", @"/"); ;//平台路劲

                var result = "";
                string vehispara = "";
                string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
                stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                               m_mainform.organ,
                                                               m_mainform.jkxlh,
                                                               "LX001",
                                                               DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
                vehispara = stoubao + string.Format(@"<body><vehispara>
                                <jylsh>{0}</jylsh>
                                <testtimes>{1}</testtimes>
                                <businessId>{2}</businessId>
                                <registCode>{3}</registCode>
                                <lxbh>{4}</lxbh>
                                <tsno>{5}</tsno>
                                <testlineno>{6}</testlineno>
			                    <url>{7}</url>
                                <wjdx>{8}</wjdx>
                                 </vehispara>
			                    </body>
                                </root>",
                                    mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                    m_mainform.testtimes,
                                    mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                    mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode,
                                    slxbh,
                                    m_mainform.organ,
                                    m_mainform.lineCode,
                                    lj,
                                    lxdx);

                result = Write("LX001" + lxbh, vehispara, mainform.businessId);

                return result;
            }
            return "";
            
        }//录像 

        public override string sjuploadASM(string businessId, model.ASM.ASMsj objasmsj, model.ASM.ASMgcsj objasmgcsj, model.ASM.ASMobdgcsj objasmobd, int ics)
        {
            string message = "1";
            string cysx = "", hcclz = "",noclz = "",cs = "",zs = "",coclz = "",co2clz = "",o2clz = "",xsxzxs = "",sdxzxs = "",
                   jsgl = "", zsgl = "", jzgl = "", hjwd = "", dqyl = "", xdsd = "", yw = "", sjxl = "", nl = "", scfz = "",
                   jczt = "", glkqxs = "", noclzwxz = "", hcclzxzh = "", noclzxzh = "", coclzxzh = "";

            string obdsjxl = "", jqmkd = "", fh = "", obdcs = "", qycgqxh = "", obdglkqxs = "", ymkd = "", fdjzs = "", jql = "",
                   jqyl = "", scgl = "", zyyl = "", hyl = "", no = "", nsbsl = "", pqwd = "", klbjqyc = "", egrkd = "", rypsyl = "";

            string hc2540limit = "", hc2540 = "", hc2540judge = "", co2540limit = "", co2540 = "", co2540judge = "", no2540limit = "", no2540 = "", no2540judge = "",
                   fdjzs2540 = "", fdjyw2540 = "", jzzgl2540 = "";


            int ids = objasmgcsj.count5025 + 1;
            if (objasmgcsj.count2540 > 1)
            {
                ids = ids + objasmgcsj.count2540 + 1;
            }
            for (int i = 0; i <= ids; i++)
            {
                obdsjxl = obdsjxl + objasmobd.Obdsjxl[i] + ",";
                jqmkd = jqmkd + objasmobd.ObdThrottle[i] + ",";
                fh = fh + objasmobd.ObdCLV[i] + ",";
                qycgqxh = qycgqxh + objasmobd.ObdPreOxygen[i] + ",";
                obdglkqxs = obdglkqxs + objasmobd.ObdExcessAirFactor[i] + ",";
                ymkd = ymkd + objasmobd.Obdymkd[i] + ",";
                obdcs = obdcs + objasmobd.ObdSpeed[i] + ",";
                fdjzs = fdjzs + objasmobd.ObdRPM[i] + ",";
                jql = jql + objasmobd.ObdAirInput[i] + ",";
                jqyl = jqyl + objasmobd.ObdAirPressure[i] + ",";
                scgl = scgl + objasmobd.Obdscgl[i] + ",";
                zyyl = zyyl + objasmobd.Obdzyyl[i] + ",";
                hyl = hyl + objasmobd.Obdhyl[i] + ",";
                no = no + objasmobd.Obdno[i] + ",";
                nsbsl = nsbsl + objasmobd.Obdnsbsl[i] + ",";
                pqwd = pqwd + objasmobd.Obdpqwd[i] + ",";
                klbjqyc = klbjqyc + objasmobd.Obdklbjqyc[i] + ",";
                egrkd = egrkd + objasmobd.Obdegrkd[i] + ",";
                rypsyl = rypsyl + objasmobd.Obdrypsyl[i] + ",";
            }
                sjxl = sjxl.Trim(',');
                jqmkd = jqmkd.Trim(',');
                fh = fh.Trim(',');
                qycgqxh = qycgqxh.Trim(',');
                obdglkqxs = obdglkqxs.Trim(',');
                ymkd = ymkd.Trim(',');
                obdcs = obdcs.Trim(',');
                fdjzs = fdjzs.Trim(',');
                jql = jql.Trim(',');
                jqyl = jqyl.Trim(',');
                scgl = scgl.Trim(',');
                zyyl = zyyl.Trim(',');
                hyl = hyl.Trim(',');
                no = no.Trim(',');
                nsbsl = nsbsl.Trim(',');
                pqwd = pqwd.Trim(',');
                klbjqyc = klbjqyc.Trim(',');
                egrkd = egrkd.Trim(',');
                rypsyl = rypsyl.Trim(',');

            for (int i = 0; i < objasmgcsj.count5025 + 1; i++)
            {
                if (i == 0)
                {
                    cysx = string.Format(@"{0}", i + 1);
                    cs = string.Format(@"{0}",objasmgcsj.m_SpeedGCSJ25[i].ToString("0.00"));
                    zs = string.Format(@"{0}",objasmgcsj.m_TrunGCSJ25[i]);
                    co2clz = string.Format(@"{0}",objasmgcsj.m_CO2GCSJ25[i]);
                    o2clz = string.Format(@"{0}", objasmgcsj.m_O2GCSJ25[i]);
                    xsxzxs = string.Format(@"{0}", objasmgcsj.m_DFGCSJ25[i].ToString("0.000")); ;
                    sdxzxs = string.Format(@"{0}", objasmgcsj.m_KHGCSJ25[i].ToString("0.000"));
                    jsgl = string.Format(@"{0}", 0.5f);
                    zsgl = string.Format(@"{0}", objasmgcsj.m_PWGCSJ25[i].ToString("0.00"));
                    jzgl = string.Format(@"{0}", objasmgcsj.m_PWGCSJ25[i].ToString("0.00"));
                    hjwd = string.Format(@"{0}", objasmgcsj.swendu25[i]);
                    dqyl = string.Format(@"{0}", objasmgcsj.sdaqiyi25[i]);
                    xdsd = string.Format(@"{0}", objasmgcsj.sshidu25[i]);
                    yw = string.Format(@"{0}", objasmgcsj.syouwen25[i]);

                    sjxl = string.Format(@"{0}", objasmgcsj.m_ProcessTime25[i].Length < 1 ? objasmgcsj.m_ProcessTime25[1] : objasmgcsj.m_ProcessTime25[i]);
                    nl = string.Format(@"{0}", objasmgcsj.m_NLGCSJ25[i]);
                    scfz = string.Format(@"{0}", objasmgcsj.m_PWGCSJ25[i].ToString("0.00"));
                    jczt = string.Format(@"{0}", objasmgcsj.m_jcztGCSJ25[i]);

                    hcclz = string.Format(@"{0}", objasmgcsj.m_HCGCSJ25[i]);
                    noclz = string.Format(@"{0}", objasmgcsj.m_NOGCSJ25[i]);
                    coclz = string.Format(@"{0}", objasmgcsj.m_COGCSJ25[i]);

                    noclzwxz = string.Format(@"{0}", objasmgcsj.m_NOGCSJ25xzxs[i]);
                    hcclzxzh = string.Format(@"{0}", objasmgcsj.m_HCGCSJ25xz[i]);
                    noclzxzh = string.Format(@"{0}", objasmgcsj.m_NOGCSJ25xz[i]);
                    coclzxzh = string.Format(@"{0}", objasmgcsj.m_COGCSJ25xz[i]);
                    glkqxs = string.Format(@"{0}", objasmgcsj.m_LAMDAGCSJ25[i]);
                }
                else
                {
                    cysx = cysx + "," + string.Format(@"{0}", i + 1);
                    hcclz = hcclz + "," + string.Format(@"{0}", objasmgcsj.m_HCGCSJ25[i]);
                    noclz = noclz + "," + string.Format(@"{0}", objasmgcsj.m_NOGCSJ25[i]);
                    cs = cs + "," + string.Format(@"{0}", objasmgcsj.m_SpeedGCSJ25[i].ToString("0.00"));
                    zs = zs + "," + string.Format(@"{0}", objasmgcsj.m_TrunGCSJ25[i]);
                    coclz = coclz + "," + string.Format(@"{0}", objasmgcsj.m_COGCSJ25[i]);
                    co2clz = co2clz + "," + string.Format(@"{0}", objasmgcsj.m_CO2GCSJ25[i]);
                    o2clz = o2clz + "," + string.Format(@"{0}", objasmgcsj.m_O2GCSJ25[i]);

                    xsxzxs = xsxzxs + "," + string.Format(@"{0}", objasmgcsj.m_DFGCSJ25[i].ToString("0.000")); ;
                    sdxzxs = sdxzxs + "," + string.Format(@"{0}", objasmgcsj.m_KHGCSJ25[i].ToString("0.000"));
                    jsgl = jsgl + "," + string.Format(@"{0}", 0.5f);
                    zsgl = zsgl + "," + string.Format(@"{0}", objasmgcsj.m_PWGCSJ25[i].ToString("0.00"));
                    jzgl = jzgl + "," + string.Format(@"{0}", objasmgcsj.m_PWGCSJ25[i].ToString("0.00"));
                    hjwd = hjwd + "," + string.Format(@"{0}", objasmgcsj.swendu25[i]);
                    dqyl = dqyl + "," + string.Format(@"{0}", objasmgcsj.sdaqiyi25[i]);
                    xdsd = xdsd + "," + string.Format(@"{0}", objasmgcsj.sshidu25[i]);
                    yw = yw + "," + string.Format(@"{0}", objasmgcsj.syouwen25[i]);
                    glkqxs = glkqxs + "," + string.Format(@"{0}", objasmgcsj.m_LAMDAGCSJ25[i]);
                    sjxl = sjxl + "," + string.Format(@"{0}", objasmgcsj.m_ProcessTime25[i]);
                    nl = nl + "," + string.Format(@"{0}", objasmgcsj.m_NLGCSJ25[i]);
                    scfz = scfz + "," + string.Format(@"{0}", objasmgcsj.m_PWGCSJ25[i].ToString("0.00"));
                    if (i > objasmgcsj.count5025 - 10)
                    {
                        jczt = jczt + "," + "2";
                    }
                    else
                    {
                        if (i < 5)
                            jczt = jczt + "," + "0";
                        else
                            jczt = jczt + "," + "1";
                    }
                    noclzwxz = noclzwxz + "," + string.Format(@"{0}", objasmgcsj.m_NOGCSJ25xzxs[i]);
                    hcclzxzh = hcclzxzh + "," + string.Format(@"{0}", objasmgcsj.m_HCGCSJ25xz[i]);
                    noclzxzh = noclzxzh + "," + string.Format(@"{0}", objasmgcsj.m_NOGCSJ25xz[i]);
                    coclzxzh = coclzxzh + "," + string.Format(@"{0}", objasmgcsj.m_COGCSJ25xz[i]);
                }
            }
            if (objasmsj.b2540)
            {
                for (int i = 0; i < objasmgcsj.count2540 + 1; i++)
                {
                    cysx = cysx + "," + string.Format(@"{0}", 95 + i + 1);
                    hcclz = hcclz + "," + string.Format(@"{0}", objasmgcsj.m_HCGCSJ40[i]);
                    noclz = noclz + "," + string.Format(@"{0}", objasmgcsj.m_NOGCSJ40[i]);
                    cs = cs + "," + string.Format(@"{0}", objasmgcsj.m_SpeedGCSJ40[i].ToString("0.00"));
                    zs = zs + "," + string.Format(@"{0}", objasmgcsj.m_TrunGCSJ40[i]);
                    coclz = coclz + "," + string.Format(@"{0}", objasmgcsj.m_COGCSJ40[i]);
                    co2clz = co2clz + "," + string.Format(@"{0}", objasmgcsj.m_CO2GCSJ40[i]);
                    o2clz = o2clz + "," + string.Format(@"{0}", objasmgcsj.m_O2GCSJC40[i]);

                    xsxzxs = xsxzxs + "," + string.Format(@"{0}", objasmgcsj.m_DFGCSJ40[i].ToString("0.000")); ;
                    sdxzxs = sdxzxs + "," + string.Format(@"{0}", objasmgcsj.m_KHGCSJ40[i].ToString("0.000"));
                    jsgl = jsgl + "," + string.Format(@"{0}", 0.5f);
                    zsgl = zsgl + "," + string.Format(@"{0}", objasmgcsj.m_PWGCSJ40[i].ToString("0.00"));
                    jzgl = jzgl + "," + string.Format(@"{0}", objasmgcsj.m_PWGCSJ40[i].ToString("0.00"));
                    hjwd = hjwd + "," + string.Format(@"{0}", objasmgcsj.swendu40[i]);
                    dqyl = dqyl + "," + string.Format(@"{0}", objasmgcsj.sdaqiyi40[i]);
                    xdsd = xdsd + "," + string.Format(@"{0}", objasmgcsj.sshidu40[i]);
                    yw = yw + "," + string.Format(@"{0}", objasmgcsj.syouwen40[i]);
                    glkqxs = glkqxs + "," + string.Format(@"{0}", objasmgcsj.m_LAMDAGCSJ40[i]);

                    sjxl = sjxl + "," + string.Format(@"{0}", objasmgcsj.m_ProcessTime40[i]);
                    nl = nl + "," + string.Format(@"{0}", objasmgcsj.m_NLGCSJ40[i]);
                    scfz = scfz + "," + string.Format(@"{0}", objasmgcsj.m_PWGCSJ40[i].ToString("0.00"));
                    if (i < 5)
                    {
                        jczt = jczt + "," + "5";//加速过程
                    }
                    else
                    {
                        if (i > objasmgcsj.count2540 - 10)
                        {
                            jczt = jczt + "," + "4";
                        }
                        else
                        {
                            jczt = jczt + "," + "3";
                        }
                    }
                    noclzwxz = noclzwxz + "," + string.Format(@"{0}", objasmgcsj.m_NOGCSJ40xzxs[i]);
                    hcclzxzh = hcclzxzh + "," + string.Format(@"{0}", objasmgcsj.m_HCGCSJ40xz[i]);
                    noclzxzh = noclzxzh + "," + string.Format(@"{0}", objasmgcsj.m_NOGCSJ40xz[i]);
                    coclzxzh = coclzxzh + "," + string.Format(@"{0}", objasmgcsj.m_COGCSJ40xz[i]);
                }
                hc2540limit = objasmsj.iHCXZ40.ToString();
                hc2540 = objasmsj.iHC40.ToString();
                hc2540judge = (objasmsj.iHC40 > objasmsj.iHCXZ40 ? 0 : 1).ToString();
                co2540limit = objasmsj.fCOXZ40.ToString();
                co2540 = objasmsj.fCO40.ToString("0.00");
                co2540judge =   (objasmsj.fCO40 > objasmsj.fCOXZ40 ? 0 : 1).ToString(); 
                no2540limit = objasmsj.iNOXZ40.ToString();
                no2540 = objasmsj.iNO40.ToString();
                no2540judge = (objasmsj.iNO40 > objasmsj.iNOXZ40 ? 0 : 1).ToString();
                fdjzs2540 =  objasmsj.fdjzs2540.ToString("0");
                fdjyw2540 =   objasmsj.fdjyw2540.ToString("0.00"); 
                jzzgl2540 = objasmsj.jzzgl2540.ToString("0.0");                                          
            }
          

            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                          m_mainform.organ,
                                                          m_mainform.jkxlh,
                                                          "GC011",
                                                          DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));

            vehispara = stoubao + string.Format(@"<body><vehispara>
                                            <jylsh>{0}</jylsh>
                                            <businessId>{1}</businessId>
                                            <registCode>{2}</registCode>
                                            <testtimes>{3}</testtimes>
                                            <cyds>{4}</cyds>
                                            <cysx>{5}</cysx>
                                            <sjxl>{6}</sjxl>
                                            <jqmkd>{7}</jqmkd>
                                            <fh>{8}</fh>
                                            <qycgqxh>{9}</qycgqxh>
                                            <glkqxs>{10}</glkqxs>
                                            <ymkd>{11}</ymkd>
                                            <cs>{12}</cs>
                                            <fdjzs>{13}</fdjzs>
                                            <jql>{14}</jql>
                                            <jqyl>{15}</jqyl>
                                            <scgl>{16}</scgl>
                                            <zyyl>{17}</zyyl>
                                            <hyl>{18}</hyl>
                                            <no>{19}</no>
                                            <nsbsl>{20}</nsbsl>
                                            <pqwd>{21}</pqwd>
                                            <klbjqyc>{22}</klbjqyc>
                                            <egrkd>{23}</egrkd>
                                            <rypsyl>{24}</rypsyl>
                                            <jczt>{25}</jczt>
                                             </vehispara>
            			                    </body>
                                            </root>",
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode,
                                m_mainform.testtimes,
                                ids,
                                cysx,
                                obdsjxl,
                                jqmkd,
                                fh,
                                qycgqxh,
                                obdglkqxs,
                                ymkd,
                                obdcs,
                                fdjzs,
                                jql,
                                jqyl,
                                scgl,
                                zyyl,
                                hyl,
                                no,
                                nsbsl,
                                pqwd,
                                klbjqyc,
                                egrkd,
                                rypsyl,
                                jczt);
            //过程数据

            if (mainform.obdzt.Contains("有"))
            {
                string sgc011 = Write("GC011", vehispara, mainform.businessId);
                if (!sgc011.ToUpper().Contains("<CODE>1</CODE>"))
                {
                    //m_mainform.baocunRJ("OBD过程数据", vehispara);
                    //m_mainform.baocunRJ("OBD过程数据结果", m_mainform.decode(sgc011));
                    message = "上传OBD过程数据失败 ";
                    return message;
                }
            }

            string vehisparaid = "";
            if (objasmsj.rllx.Contains("3"))//wwt20190611
            {
                if (ics == 0)
                {
                    vehisparaid = " id=\"0\"";
                }
                else
                {
                    vehisparaid = " id=\"1\"";
                }
            }
            vehispara = "";
            stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                           m_mainform.jkxlh,
                                                           "GC002",
                                                           DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            vehispara = stoubao + string.Format(@"<body><vehispara{27}>
                                            <jylsh>{0}</jylsh>
                                            <registCode>{1}</registCode>
                                            <businessId>{2}</businessId>
                                            <testtimes>{3}</testtimes>
                                            <cyds>{4}</cyds>
                                            <cysx>{5}</cysx>
                                            <hcclz>{6}</hcclz>
                                            <noclz>{7}</noclz>
                                            <cs>{8}</cs>
                                            <zs>{9}</zs>
                                            <coclz>{10}</coclz>
                                            <co2clz>{11}</co2clz>
                                            <o2clz>{12}</o2clz>
                                            <xsxzxs>{13}</xsxzxs>
                                            <sdxzxs>{14}</sdxzxs>
                                            <jsgl>{15}</jsgl>
                                            <zsgl>{16}</zsgl>
                                            <jzgl>{17}</jzgl>
                                            <hjwd>{18}</hjwd>
                                            <dqyl>{19}</dqyl>
                                            <xdsd>{20}</xdsd>
                                            <yw>{21}</yw>
                                            <sjxl>{22}</sjxl>
                                            <nl>{23}</nl>
                                            <scfz>{24}</scfz>
                                            <glkqxs>{25}</glkqxs>
                                            <jczt>{26}</jczt>
                                             </vehispara>
            			                    </body>
                                            </root>",
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode,
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                m_mainform.testtimes,
                                ids,
                                cysx,
                                hcclz,
                                noclz,
                                cs,
                                zs,
                                coclz,
                                co2clz,
                                o2clz,
                                xsxzxs,
                                sdxzxs,
                                jsgl,
                                zsgl,
                                jzgl,
                                hjwd,
                                dqyl,
                                xdsd,
                                yw,
                                sjxl,
                                nl,
                                scfz,
                                glkqxs,
                                jczt,
                                vehisparaid);

            string sgc002 = Write("GC002", vehispara, mainform.businessId);

            if (!sgc002.ToUpper().Contains("<CODE>1</CODE>"))
            {
                //m_mainform.baocunRJ("ASM过程数据", vehispara); //
                //m_mainform.baocunRJ("ASM过程数据结果", m_mainform.decode(sgc002)); //
                message = "上传ASM过程数据失败 ";
                return message;
            }

            vehispara = "";
            stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                           m_mainform.jkxlh,
                                                           "JC002",
                                                           DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));

            vehispara = stoubao + string.Format(@"<body><vehispara{33}>
                                            <jylsh>{0}</jylsh>
                                            <registCode>{1}</registCode>
                                            <businessId>{2}</businessId>
                                            <testtimes>{3}</testtimes>
                                            <wd>{4}</wd>
                                            <dqy>{5}</dqy>
                                            <xdsd>{6}</xdsd>
                                            <lambda>{7}</lambda>
                                            <hc5025limit>{8}</hc5025limit>
                                            <hc5025>{9}</hc5025>
                                            <hc5025judge>{10}</hc5025judge>
                                            <co5025limit>{11}</co5025limit>
                                            <co5025>{12}</co5025>
                                            <co5025judge>{13}</co5025judge>
                                            <no5025limit>{14}</no5025limit>
                                            <no5025>{15}</no5025>
                                            <no5025judge>{16}</no5025judge>
                                            <fdjzs5025>{17}</fdjzs5025>
                                            <fdjyw5025>{18}</fdjyw5025>
                                            <hc2540limit>{19}</hc2540limit>
                                            <hc2540>{20}</hc2540>
                                            <hc2540judge>{21}</hc2540judge>
                                            <co2540limit>{22}</co2540limit>
                                            <co2540>{23}</co2540>
                                            <co2540judge>{24}</co2540judge>
                                            <no2540limit>{25}</no2540limit>
                                            <no2540>{26}</no2540>
                                            <no2540judge>{27}</no2540judge>
                                            <fdjzs2540>{28}</fdjzs2540>
                                            <fdjyw2540>{29}</fdjyw2540>
                                            <jzzgl5025>{30}</jzzgl5025>
                                            <jzzgl2540>{31}</jzzgl2540>
                                            <result>{32}</result>
                                             </vehispara>
            			                    </body>
                                            </root>",
                                            mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                            mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode,
                                            mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                            m_mainform.testtimes,
                                            objasmsj.fwendu.ToString("0.00"),
                                            objasmsj.fshidu.ToString("0.00"),
                                            objasmsj.fdaqiya.ToString("0.00"),
                                            objasmsj.lamda25.ToString("0.00"),
                                            objasmsj.iHCXZ25,
                                            objasmsj.iHC25,
                                            (objasmsj.iHC25 >objasmsj.iHCXZ25 ? 0 : 1).ToString(),
                                            objasmsj.fCOXZ25.ToString("0.0"),
                                            objasmsj.fCO25.ToString("0.00"),
                                            (objasmsj.fCO25 > objasmsj.fCOXZ25 ? 0 : 1).ToString(),
                                            objasmsj.iNOXZ25,
                                            objasmsj.iNO25,
                                            (objasmsj.iNO25 > objasmsj.iNOXZ25 ? 0 : 1).ToString(),
                                            objasmsj.fdjzs5025,
                                            objasmsj.fdjyw5025.ToString("0.00"),
                                            hc2540limit,
                                            hc2540,
                                            hc2540judge,
                                            co2540limit,
                                            co2540,
                                            co2540judge,
                                            no2540limit,
                                            no2540,
                                            no2540judge,
                                            fdjzs2540,
                                            fdjyw2540,
                                            objasmsj.jzzgl5025.ToString("0.0"),
                                            jzzgl2540,
                                            objasmsj.result,
                                            vehisparaid);


            //检测结果
            string sjc002 = Write("JC002", vehispara, mainform.businessId);

            if (!sjc002.ToUpper().Contains("<CODE>1</CODE>"))
            {
                //m_mainform.baocunRJ("ASM检测数据", vehispara); //
                //m_mainform.baocunRJ("ASM检测数据结果", m_mainform.decode(sjc002)); //
                message = "上传ASM结果数据失败 ";
                return message;
            }
            else
            {
                return "1";
            }

            return message;
        }

        public override string  sjuploadSDS(string businessId, model.SDS.SDSsj objasmsj, model.SDS.SDSgcsj objasmgcsj, model.ASM.ASMobdgcsj objasmobd)
        {
            string message = "1";
            string cysx = "", hcclz = "", zs = "", coclz = "", glkqxs = "", sjxl = "", yw = "", co2clz = "", o2clz = "", hjwd = "", dqyl = "", xdsd = "", jczt = "";

            string obdsjxl = "", jqmkd = "", fh = "", obdcs = "", qycgqxh = "", obdglkqxs = "", ymkd = "", fdjzs = "", jql = "",
                  jqyl = "", scgl = "", zyyl = "", hyl = "", no = "", nsbsl = "", pqwd = "", klbjqyc = "", egrkd = "", rypsyl = "";

            for (int i = 0; i <= objasmobd.Obdiobd; i++)
            {
                obdsjxl = obdsjxl + objasmobd.Obdsjxl[i] + ",";
                jqmkd = jqmkd + objasmobd.ObdThrottle[i] + ",";
                fh = fh + objasmobd.ObdCLV[i] + ",";
                qycgqxh = qycgqxh + objasmobd.ObdPreOxygen[i] + ",";
                obdglkqxs = obdglkqxs + objasmobd.ObdExcessAirFactor[i] + ",";
                ymkd = ymkd + objasmobd.Obdymkd[i] + ",";
                obdcs = obdcs + objasmobd.ObdSpeed[i] + ",";
                fdjzs = fdjzs + objasmobd.ObdRPM[i] + ",";
                jql = jql + objasmobd.ObdAirInput[i] + ",";
                jqyl = jqyl + objasmobd.ObdAirPressure[i] + ",";
                scgl = scgl + objasmobd.Obdscgl[i] + ",";
                zyyl = zyyl + objasmobd.Obdzyyl[i] + ",";
                hyl = hyl + objasmobd.Obdhyl[i] + ",";
                no = no + objasmobd.Obdno[i] + ",";
                nsbsl = nsbsl + objasmobd.Obdnsbsl[i] + ",";
                pqwd = pqwd + objasmobd.Obdpqwd[i] + ",";
                klbjqyc = klbjqyc + objasmobd.Obdklbjqyc[i] + ",";
                egrkd = egrkd + objasmobd.Obdegrkd[i] + ",";
                rypsyl = rypsyl + objasmobd.Obdrypsyl[i] + ",";
            }
            sjxl = sjxl.Trim(',');
            jqmkd = jqmkd.Trim(',');
            fh = fh.Trim(',');
            qycgqxh = qycgqxh.Trim(',');
            obdglkqxs = obdglkqxs.Trim(',');
            ymkd = ymkd.Trim(',');
            obdcs = obdcs.Trim(',');
            fdjzs = fdjzs.Trim(',');
            jql = jql.Trim(',');
            jqyl = jqyl.Trim(',');
            scgl = scgl.Trim(',');
            zyyl = zyyl.Trim(',');
            hyl = hyl.Trim(',');
            no = no.Trim(',');
            nsbsl = nsbsl.Trim(',');
            pqwd = pqwd.Trim(',');
            klbjqyc = klbjqyc.Trim(',');
            egrkd = egrkd.Trim(',');
            rypsyl = rypsyl.Trim(',');

            for (int i = 0; i < 30; i++)
            {
                if (i == 0)
                {
                    cysx = string.Format(@"{0}", i + 1);
                    hcclz = string.Format(@"{0}", objasmgcsj.m_HCGCSJYR[i]);
                    zs = string.Format(@"{0}",objasmgcsj.m_TrunGCSJYR[i]);
                    coclz = string.Format(@"{0}", objasmgcsj.m_COGCSJYR[i]);
                    glkqxs = string.Format(@"{0}", objasmgcsj.m_LAMDAGCSJYR[i]);
                    sjxl = string.Format(@"{0}", objasmgcsj.m_ProcessTimeYR[i]);
                    yw = string.Format(@"{0}", objasmgcsj.m_YWGCSJYR[i].ToString("0.0"));
                    co2clz = string.Format(@"{0}", objasmgcsj.m_CO2GCSJYR[i]);
                    o2clz = string.Format(@"{0}", objasmgcsj.m_O2GCSJYR[i]);
                    hjwd = string.Format(@"{0}", objasmgcsj.m_wendu[i]);
                    dqyl = string.Format(@"{0}", objasmgcsj.m_daqiya[i]);
                    xdsd = string.Format(@"{0}", objasmgcsj.m_shidu[i]);
                    jczt = string.Format(@"{0}", 0);
                }
                else
                {
                    cysx = cysx + "," + string.Format(@"{0}", i + 1);
                    hcclz = hcclz + "," + string.Format(@"{0}", objasmgcsj.m_HCGCSJYR[i]);
                    zs = zs + "," + string.Format(@"{0}", objasmgcsj.m_TrunGCSJYR[i]);
                    coclz = coclz + "," + string.Format(@"{0}", objasmgcsj.m_COGCSJYR[i]);
                    glkqxs = glkqxs + "," + string.Format(@"{0}", objasmgcsj.m_LAMDAGCSJYR[i]);
                    yw = yw + "," + string.Format(@"{0}", objasmgcsj.m_YWGCSJYR[i].ToString("0.0"));
                    co2clz = co2clz + "," + string.Format(@"{0}", objasmgcsj.m_CO2GCSJYR[i]);
                    o2clz = o2clz + "," + string.Format(@"{0}", objasmgcsj.m_O2GCSJYR[i]);
                    hjwd = hjwd + "," + string.Format(@"{0}", objasmgcsj.m_wendu[i]);
                    dqyl = dqyl + "," + string.Format(@"{0}", objasmgcsj.m_daqiya[i]);
                    xdsd = xdsd + "," + string.Format(@"{0}", objasmgcsj.m_shidu[i]);
                    sjxl = sjxl + "," + string.Format(@"{0}", objasmgcsj.m_ProcessTimeYR[i]);
                    jczt = jczt + "," + string.Format(@"{0}", 0);
                }
            }
            for (int i = 0; i < 15; i++)
            {
                cysx = cysx + "," + string.Format(@"{0}", i + 1 + 30);
                hcclz = hcclz + "," + string.Format(@"{0}", objasmgcsj.m_HCGCSJG15[i]);
                zs = zs + "," + string.Format(@"{0}", objasmgcsj.m_TrunGCSJG15[i]);
                coclz = coclz + "," + string.Format(@"{0}", objasmgcsj.m_COGCSJG15[i]);
                glkqxs = glkqxs + "," + string.Format(@"{0}", objasmgcsj.m_LAMDAGCSJG15[i]);
                yw = yw + "," + string.Format(@"{0}", objasmgcsj.m_YWGCSJG15[i].ToString("0.0"));
                co2clz = co2clz + "," + string.Format(@"{0}", objasmgcsj.m_CO2GCSJG15[i]);
                o2clz = o2clz + "," + string.Format(@"{0}", objasmgcsj.m_O2GCSJG15[i]);
                hjwd = hjwd + "," + string.Format(@"{0}", objasmgcsj.m_wendu[30 + i]);
                dqyl = dqyl + "," + string.Format(@"{0}", objasmgcsj.m_daqiya[30 + i]);
                xdsd = xdsd + "," + string.Format(@"{0}", objasmgcsj.m_shidu[30 + i]);

                sjxl = sjxl + "," + string.Format(@"{0}", objasmgcsj.m_ProcessTimeG15[i]);
                jczt = jczt + "," + string.Format(@"{0}", 1);

            }
            for (int i = 0; i < 30; i++)
            {
                cysx = cysx + "," + string.Format(@"{0}", i + 1 + 30 + 15);
                hcclz = hcclz + "," + string.Format(@"{0}", objasmgcsj.m_HCGCSJG[i]);
                //if (objasmgcsj.m_TrunGCSJG[i] > 2600 || objasmgcsj.m_TrunGCSJG[i] < 2400)
                //{
                //    if (szhuansu.Contains("有"))
                //    {
                //        if (scllx.Contains("重"))
                //        {
                //            if (objasmgcsj.m_TrunGCSJG[i] > 2000 || objasmgcsj.m_TrunGCSJG[i] < 1600)
                //            {
                //                objasmgcsj.m_TrunGCSJG[i] = 1830 + 10 * m_mainform.getRandom(0, 3) + m_mainform.getRandom(0, 9);
                //            }
                //        }
                //        else
                //        {
                //            if (objasmgcsj.m_TrunGCSJG[i] > 2600 || objasmgcsj.m_TrunGCSJG[i] < 2400)
                //            {
                //                objasmgcsj.m_TrunGCSJG[i] = 2430 + 10 * m_mainform.getRandom(0, 3) + m_mainform.getRandom(0, 9);
                //            }
                //        }
                //    }
                //}
                zs = zs + "," + string.Format(@"{0}", objasmgcsj.m_TrunGCSJG[i]);
                coclz = coclz + "," + string.Format(@"{0}", objasmgcsj.m_COGCSJG[i]);
                glkqxs = glkqxs + "," + string.Format(@"{0}", objasmgcsj.m_LAMDAGCSJG[i]);
                yw = yw + "," + string.Format(@"{0}", objasmgcsj.m_YWGCSJG[i].ToString("0.0"));
                co2clz = co2clz + "," + string.Format(@"{0}", objasmgcsj.m_CO2GCSJG[i]);
                o2clz = o2clz + "," + string.Format(@"{0}", objasmgcsj.m_O2GCSJG[i]);
                hjwd = hjwd + "," + string.Format(@"{0}", objasmgcsj.m_wendu[30 + 15 + i]);
                dqyl = dqyl + "," + string.Format(@"{0}", objasmgcsj.m_daqiya[30 + 15 + i]);
                xdsd = xdsd + "," + string.Format(@"{0}", objasmgcsj.m_shidu[30 + 15 + i]);
                sjxl = sjxl + "," + string.Format(@"{0}", objasmgcsj.m_ProcessTimeG[i]);
                jczt = jczt + "," + string.Format(@"{0}", 2);
            }
            if (objasmobd.Obdiobd>74)
            {
                for (int i = 0; i < 15; i++)
                {
                    cysx = cysx + "," + string.Format(@"{0}", i + 1 + 30 + 15 + 30);
                    hcclz = hcclz + "," + string.Format(@"{0}", objasmgcsj.m_HCGCSJD15[i]);
                    zs = zs + "," + string.Format(@"{0}", objasmgcsj.m_TrunGCSJD15[i]);
                    coclz = coclz + "," + string.Format(@"{0}", objasmgcsj.m_COGCSJD15[i]);
                    glkqxs = glkqxs + "," + string.Format(@"{0}", objasmgcsj.m_LAMDAGCSJD15[i]);
                    yw = yw + "," + string.Format(@"{0}", objasmgcsj.m_YWGCSJD15[i].ToString("0.0"));
                    co2clz = co2clz + "," + string.Format(@"{0}", objasmgcsj.m_CO2GCSJD15[i]);
                    o2clz = o2clz + "," + string.Format(@"{0}", objasmgcsj.m_O2GCSJD15[i]);
                    hjwd = hjwd + "," + string.Format(@"{0}", objasmgcsj.m_wendu[30 + 15 + 30 + i]);
                    dqyl = dqyl + "," + string.Format(@"{0}", objasmgcsj.m_daqiya[30 + 15 + 30 + i]);
                    xdsd = xdsd + "," + string.Format(@"{0}", objasmgcsj.m_shidu[30 + 15 + 30 + i]);
                    sjxl = sjxl + "," + string.Format(@"{0}", objasmgcsj.m_ProcessTimeD15[i]);
                    jczt = jczt + "," + string.Format(@"{0}", 3);
                }
                for (int i = 0; i < 30; i++)
                {
                    cysx = cysx + "," + string.Format(@"{0}", i + 1 + 30 + 15 + 30 + 15);
                    hcclz = hcclz + "," + string.Format(@"{0}", objasmgcsj.m_HCGCSJD[i]);
                    zs = zs + "," + string.Format(@"{0}", objasmgcsj.m_TrunGCSJD[i]);
                    coclz = coclz + "," + string.Format(@"{0}", objasmgcsj.m_COGCSJD[i]);
                    glkqxs = glkqxs + "," + string.Format(@"{0}", objasmgcsj.m_LAMDAGCSJD[i]);
                    yw = yw + "," + string.Format(@"{0}", objasmgcsj.m_YWGCSJD[i].ToString("0.0"));
                    co2clz = co2clz + "," + string.Format(@"{0}", objasmgcsj.m_CO2GCSJD[i]);
                    o2clz = o2clz + "," + string.Format(@"{0}", objasmgcsj.m_O2GCSJD[i]);
                    hjwd = hjwd + "," + string.Format(@"{0}", objasmgcsj.m_wendu[30 + 15 + 45 + i]);
                    dqyl = dqyl + "," + string.Format(@"{0}", objasmgcsj.m_daqiya[30 + 15 + 45 + i]);
                    xdsd = xdsd + "," + string.Format(@"{0}", objasmgcsj.m_shidu[30 + 15 + 45 + i]);
                    sjxl = sjxl + "," + string.Format(@"{0}", objasmgcsj.m_ProcessTimeD[i]);
                    jczt = jczt + "," + string.Format(@"{0}", 4);
                }
            }

            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                          m_mainform.organ,
                                                          m_mainform.jkxlh,
                                                          "GC011",
                                                          DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));

            vehispara = stoubao + string.Format(@"<body><vehispara>
                                            <jylsh>{0}</jylsh>
                                            <businessId>{1}</businessId>
                                            <registCode>{2}</registCode>
                                            <testtimes>{3}</testtimes>
                                            <cyds>{4}</cyds>
                                            <cysx>{5}</cysx>
                                            <sjxl>{6}</sjxl>
                                            <jqmkd>{7}</jqmkd>
                                            <fh>{8}</fh>
                                            <qycgqxh>{9}</qycgqxh>
                                            <glkqxs>{10}</glkqxs>
                                            <ymkd>{11}</ymkd>
                                            <cs>{12}</cs>
                                            <fdjzs>{13}</fdjzs>
                                            <jql>{14}</jql>
                                            <jqyl>{15}</jqyl>
                                            <scgl>{16}</scgl>
                                            <zyyl>{17}</zyyl>
                                            <hyl>{18}</hyl>
                                            <no>{19}</no>
                                            <nsbsl>{20}</nsbsl>
                                            <pqwd>{21}</pqwd>
                                            <klbjqyc>{22}</klbjqyc>
                                            <egrkd>{23}</egrkd>
                                            <rypsyl>{24}</rypsyl>
                                            <jczt>{25}</jczt>
                                             </vehispara>
            			                    </body>
                                            </root>",
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode,
                                m_mainform.testtimes,
                                objasmobd.Obdiobd +1,
                                cysx,
                                obdsjxl,
                                jqmkd,
                                fh,
                                qycgqxh,
                                obdglkqxs,
                                ymkd,
                                obdcs,
                                fdjzs,
                                jql,
                                jqyl,
                                scgl,
                                zyyl,
                                hyl,
                                no,
                                nsbsl,
                                pqwd,
                                klbjqyc,
                                egrkd,
                                rypsyl,
                                jczt);
            //过程数据

            if (mainform.obdzt.Contains("有"))
            {
                string sgc011 = Write("GC011", vehispara, mainform.businessId);
                if (!sgc011.ToUpper().Contains("<CODE>1</CODE>"))
                {
                    //m_mainform.baocunRJ("OBD过程数据", vehispara);
                    //m_mainform.baocunRJ("OBD过程数据结果", m_mainform.decode(sgc011));
                    message = "上传OBD过程数据失败 ";
                    return message;
                }
            }

            vehispara = "";
            stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                           m_mainform.jkxlh,
                                                           "GC003",
                                                           DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            vehispara = stoubao + string.Format(@"<body><vehispara>
                                <jylsh>{0}</jylsh>
                                <registCode>{1}</registCode>
                                <businessId>{2}</businessId>
                                <testtimes>{3}</testtimes>
                                <cyds>{4}</cyds>
                                <cysx>{5}</cysx>
                                <hcclz>{6}</hcclz>
			                    <zs>{7}</zs>
			                    <coclz>{8}</coclz>
			                    <glkqxs>{9}</glkqxs>
			                    <yw>{10}</yw>
			                    <co2clz>{11}</co2clz>
			                    <o2clz>{12}</o2clz>
			                    <hjwd>{13}</hjwd>
			                    <dqyl>{14}</dqyl>
			                    <xdsd>{15}</xdsd>
			                    <sjxl>{16}</sjxl>
			                    <jczt>{17}</jczt>
                                 </vehispara>
			                    </body>
                                </root>",
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode,
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                m_mainform.testtimes,
                                objasmobd.Obdiobd +1,
                                cysx,
                                hcclz,
                                zs,
                                coclz,
                                glkqxs,
                                yw,
                                co2clz,
                                o2clz,
                                hjwd,
                                dqyl,
                                xdsd,
                                sjxl,
                                jczt);

            string sgc003 = Write("GC003", vehispara, mainform.businessId);
            if (!sgc003.ToUpper().Contains("<CODE>1</CODE>"))
            {
                //m_mainform.baocunRJ("双怠速过程数据", vehispara); //
                //m_mainform.baocunRJ("双怠速过程数据结果", m_mainform.decode(sgc003)); //
                message = "上传双怠速过程数据失败 ";
                return message;
              
            }

            vehispara = "";
            stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                           m_mainform.jkxlh,
                                                           "JC003",
                                                           DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));

            vehispara = stoubao + string.Format(@"<body><vehispara>
                                <jylsh>{0}</jylsh>
                                <registCode>{1}</registCode>
                                <businessId>{2}</businessId>
                                <testtimes>{3}</testtimes>
                                <wd>{4}</wd>
                                <dqy>{5}</dqy>
                                <xdsd>{6}</xdsd>
			                    <lambdadown>{7}</lambdadown>
			                    <lambdaup>{8}</lambdaup>
			                    <lambda>{9}</lambda>
			                    <lambdajudge>{10}</lambdajudge>
			                    <lscolimit>{11}</lscolimit>
			                    <lscoresult>{12}</lscoresult>
			                    <lscojudge>{13}</lscojudge>
			                    <lshclimit>{14}</lshclimit>
			                    <lshcresult>{15}</lshcresult>
			                    <lshcjudge>{16}</lshcjudge>
			                    <dszs>{17}</dszs>
                                <ddsjywd>{18}</ddsjywd>
                                <hscolimit>{19}</hscolimit>
                                <hscoresult>{20}</hscoresult>
                                <hscojudge>{21}</hscojudge>
                                <hshcresult>{22}</hshcresult>
                                <hshclimit>{23}</hshclimit>
                                <hshcjudge>{24}</hshcjudge>
                                <gdszs>{25}</gdszs>
                                <gdsjywd>{26}</gdsjywd>
                                <result>{27}</result>
                                 </vehispara>
			                    </body>
                                </root>",
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode,
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                m_mainform.testtimes,
                                objasmsj.fwendu,
                                objasmsj.fdaqiya,
                                objasmsj.fshidu,
                                "0.95",
                                "1.05",
                                objasmsj.fLAMDAG.ToString("0.00"),
                                objasmsj.lambdajudge,
                                objasmsj.fCOXZD,
                                objasmsj.fCOD.ToString("0.00"),
                                objasmsj.fCOXZD > objasmsj.fCOD ? "1":"0",
                                objasmsj.iHCXZD,
                                objasmsj.iHCD,
                                objasmsj.iHCXZD > objasmsj.iHCD ? "1":"0",
                                objasmsj.dsfdjzs,
                                objasmsj.ddsjywd,
                                objasmsj.fCOXZG,
                                objasmsj.fCOG.ToString("0.00"),
                                objasmsj.fCOXZG > objasmsj.fCOG ? "1" : "0",
                                objasmsj.iHCG,
                                objasmsj.iHCXZG,
                                objasmsj.iHCXZG > objasmsj.iHCG ? "1" : "0",
                                objasmsj.gdsfdjzs,
                                objasmsj.gdsjywd,
                                objasmsj.bgood?"1":"0");

       
            //检测结果
            string sjc003 = Write("JC003", vehispara, mainform.businessId);
            if (!sjc003.ToUpper().Contains("<CODE>1</CODE>"))
            {
                //m_mainform.baocunRJ("双怠速结果数据", vehispara); //
                //m_mainform.baocunRJ("双怠速结果数据结果", m_mainform.decode(sjc003)); 
                message = "上传双怠速结果数据失败 ";
                return message;
            }
            return message;
        }

        public override string  sjuploadZYJS(string businessId, model.ZYJS.ZYJSsj objsj, model.ZYJS.ZYJSgcsj objgcsj, model.LUG.LUGobdgcsj objobdgcsj)
        {
            string message = "1";
            string cysx = "", ydzds = "", fdjdszs = "", yw = "", sjxl = "", jczt = "", gklx = "1";
            int icount = 1;

            string obdsjxl = "", jqmkd = "", fh = "", obdcs = "", qycgqxh = "", obdglkqxs = "", ymkd = "", fdjzs = "", jql = "",
                  jqyl = "", scgl = "", zyyl = "", hyl = "", no = "", nsbsl = "", pqwd = "", klbjqyc = "", egrkd = "", rypsyl = "";

            for (int i = 0; i <= 41; i++)
            {
                obdsjxl = obdsjxl + objobdgcsj.Obdsjxl[i] + ",";
                jqmkd = jqmkd + objobdgcsj.ObdThrottle[i] + ",";
                fh = fh + objobdgcsj.ObdCLV[i] + ",";
                qycgqxh = qycgqxh + objobdgcsj.ObdPreOxygen[i] + ",";
                obdglkqxs = obdglkqxs + objobdgcsj.ObdExcessAirFactor[i] + ",";
                ymkd = ymkd + objobdgcsj.Obdymkd[i] + ",";
                obdcs = obdcs + objobdgcsj.ObdSpeed[i] + ",";
                fdjzs = fdjzs + objobdgcsj.ObdRPM[i] + ",";
                jql = jql + objobdgcsj.ObdAirInput[i] + ",";
                jqyl = jqyl + objobdgcsj.ObdAirPressure[i] + ",";
                scgl = scgl + objobdgcsj.ObdPower[i] + ",";
                zyyl = zyyl + objobdgcsj.ObdBoostPressure[i] + ",";
                hyl = hyl + objobdgcsj.ObdFuelConsumption[i] + ",";
                no = no + objobdgcsj.ObdNOx[i] + ",";
                nsbsl = nsbsl + objobdgcsj.ObdSCR[i] + ",";
                pqwd = pqwd + objobdgcsj.ObdEGT[i] + ",";
                klbjqyc = klbjqyc + objobdgcsj.ObdDPF[i] + ",";
                egrkd = egrkd + objobdgcsj.ObdEGR[i] + ",";
                rypsyl = rypsyl + objobdgcsj.ObdEFI[i] + ",";
            }
            sjxl = sjxl.Trim(',');
            jqmkd = jqmkd.Trim(',');
            fh = fh.Trim(',');
            qycgqxh = qycgqxh.Trim(',');
            obdglkqxs = obdglkqxs.Trim(',');
            ymkd = ymkd.Trim(',');
            obdcs = obdcs.Trim(',');
            fdjzs = fdjzs.Trim(',');
            jql = jql.Trim(',');
            jqyl = jqyl.Trim(',');
            scgl = scgl.Trim(',');
            zyyl = zyyl.Trim(',');
            hyl = hyl.Trim(',');
            no = no.Trim(',');
            nsbsl = nsbsl.Trim(',');
            pqwd = pqwd.Trim(',');
            klbjqyc = klbjqyc.Trim(',');
            egrkd = egrkd.Trim(',');
            rypsyl = rypsyl.Trim(',');

            for (int i = 0; i < 4; i++)
            {
                for (int k = 0; k < 13; k++)
                {
                    
                    if (icount == 1 || icount == 2 || icount == 3)
                    {
                        gklx = "1";
                    }
                    else if (icount == 14 || icount == 15 || icount == 16)
                    {
                        gklx = "2";
                    }
                    else if (icount == 27 || icount == 28 || icount == 29)
                    {
                        gklx = "3";
                    }
                    else if (icount == 40 || icount == 41 || icount == 42)
                    {
                        gklx = "4";
                    }
                    else
                    {
                        gklx = "0";
                    }
                    if (i == 0 && k == 0)
                    {
                        cysx = string.Format(@"{0}", icount);
                        ydzds = string.Format(@"{0}", objgcsj.m_SKGCSJK[i, k]);
                        fdjdszs = string.Format(@"{0}", objgcsj.m_SKGCSJTurn[i, k]);
                        yw = string.Format(@"{0}", objgcsj.m_SKGCSJyw[i, k]);
                        sjxl = string.Format(@"{0}", objgcsj.m_SKGCSJTime[i, k]);
                        jczt = string.Format(@"{0}", gklx);
                        icount++;
                    }
                    else
                    {
                        if (i < 3)
                        {
                            cysx = cysx + "," + string.Format(@"{0}", icount);
                            ydzds = ydzds + "," + string.Format(@"{0}", objgcsj.m_SKGCSJK[i, k]);
                            fdjdszs = fdjdszs + "," + string.Format(@"{0}", objgcsj.m_SKGCSJTurn[i, k]);
                            yw = yw + "," + string.Format(@"{0}", objgcsj.m_SKGCSJyw[i, k]);
                            sjxl = sjxl + "," + string.Format(@"{0}", objgcsj.m_SKGCSJTime[i, k]);
                            jczt = jczt + "," + string.Format(@"{0}", gklx);
                            icount++;
                        }
                        else
                        {
                            if (k < 3)
                            {
                                cysx = cysx + "," + string.Format(@"{0}", icount);
                                ydzds = ydzds + "," + string.Format(@"{0}", objgcsj.m_SKGCSJK[i, k]);
                                fdjdszs = fdjdszs + "," + string.Format(@"{0}", objgcsj.m_SKGCSJTurn[i, k]);
                                yw = yw + "," + string.Format(@"{0}", objgcsj.m_SKGCSJyw[i, k]);
                                sjxl = sjxl + "," + string.Format(@"{0}", objgcsj.m_SKGCSJTime[i, k]);
                                jczt = jczt + "," + string.Format(@"{0}", gklx);
                                icount++;
                            }
                        }
                    }
                }
            }

            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                          m_mainform.organ,
                                                          m_mainform.jkxlh,
                                                          "GC011",
                                                          DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));

            vehispara = stoubao + string.Format(@"<body><vehispara>
                                            <jylsh>{0}</jylsh>
                                            <businessId>{1}</businessId>
                                            <registCode>{2}</registCode>
                                            <testtimes>{3}</testtimes>
                                            <cyds>{4}</cyds>
                                            <cysx>{5}</cysx>
                                            <sjxl>{6}</sjxl>
                                            <jqmkd>{7}</jqmkd>
                                            <fh>{8}</fh>
                                            <qycgqxh>{9}</qycgqxh>
                                            <glkqxs>{10}</glkqxs>
                                            <ymkd>{11}</ymkd>
                                            <cs>{12}</cs>
                                            <fdjzs>{13}</fdjzs>
                                            <jql>{14}</jql>
                                            <jqyl>{15}</jqyl>
                                            <scgl>{16}</scgl>
                                            <zyyl>{17}</zyyl>
                                            <hyl>{18}</hyl>
                                            <no>{19}</no>
                                            <nsbsl>{20}</nsbsl>
                                            <pqwd>{21}</pqwd>
                                            <klbjqyc>{22}</klbjqyc>
                                            <egrkd>{23}</egrkd>
                                            <rypsyl>{24}</rypsyl>
                                            <jczt>{25}</jczt>
                                             </vehispara>
            			                    </body>
                                            </root>",
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode,
                                m_mainform.testtimes,
                                "42",
                                cysx,
                                obdsjxl,
                                jqmkd,
                                fh,
                                qycgqxh,
                                obdglkqxs,
                                ymkd,
                                obdcs,
                                fdjzs,
                                jql,
                                jqyl,
                                scgl,
                                zyyl,
                                hyl,
                                no,
                                nsbsl,
                                pqwd,
                                klbjqyc,
                                egrkd,
                                rypsyl,
                                jczt);
            //过程数据

            WebReferenceZHHB.WSServiceImplService m_vesd = new WebReferenceZHHB.WSServiceImplService();
            m_vesd.Url = m_mainform.surl;
            if (mainform.obdzt.Contains("有"))
            {
                string sgc011 = Write("GC011", vehispara, mainform.businessId);
                if (!sgc011.ToUpper().Contains("<CODE>1</CODE>"))
                {
                    //m_mainform.baocunRJ("OBD过程数据", vehispara);
                    //m_mainform.baocunRJ("OBD过程数据结果", m_mainform.decode(sgc011));
                    message = "上传OBD过程数据失败 ";
                    return message;
                }
            }
            vehispara = "";
            stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                           m_mainform.jkxlh,
                                                           "GC005",
                                                           DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            vehispara = stoubao + string.Format(@"<body><vehispara>
                                                            <jylsh>{0}</jylsh>
                                                            <registCode>{1}</registCode>
                                                            <businessId>{2}</businessId>
                                                            <testtimes>{3}</testtimes>
                                                            <cyds>{4}</cyds>
                                                            <cysx>{5}</cysx>
                                                            <ydzds>{6}</ydzds>
                                                            <fdjdszs>{7}</fdjdszs>
                                                            <yw>{8}</yw>
                                                            <sjxl>{9}</sjxl>
                                                            <jczt>{10}</jczt>
                                                            </vehispara>
            			                                    </body>
                                                            </root>",
                                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                                mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode,
                                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                                m_mainform.testtimes,
                                                "42",
                                                cysx,
                                                ydzds,
                                                fdjdszs,
                                                yw,
                                                sjxl,
                                                jczt);



            string sgc005 = Write("GC005", vehispara, mainform.businessId);
            if (!sgc005.ToUpper().Contains("<CODE>1</CODE>"))
            {
                //m_mainform.baocunRJ("自由加速过程数据", vehispara); //
                //m_mainform.baocunRJ("自由加速过程数据结果", m_mainform.decode(sgc005)); //
                message = "上传自由加速过程数据失败 ";
                return message;
            }

            vehispara = "";
            stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                           m_mainform.jkxlh,
                                                           "JC005",
                                                           DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));

            vehispara = stoubao + string.Format(@"<body><vehispara>
                                            <jylsh>{0}</jylsh>
                                            <registCode>{1}</registCode>
                                            <businessId>{2}</businessId>
                                            <testtimes>{3}</testtimes>
                                            <wd>{4}</wd>
                                            <dqy>{5}</dqy>
                                            <xdsd>{6}</xdsd>
                                            <idlerev>{7}</idlerev>
                                            <enginespeed>{8}</enginespeed>
                                            <fdjzs4>{9}</fdjzs4>
                                            <fdjzs3>{10}</fdjzs3>
                                            <fdjzs2>{11}</fdjzs2>
                                            <fdjzs1>{12}</fdjzs1>
                                            <smokek4>{13}</smokek4>
                                            <smokek3>{14}</smokek3>
                                            <smokek2>{15}</smokek2>
                                            <smokek1>{16}</smokek1>
                                            <smokeavg>{17}</smokeavg>
                                            <result>{18}</result>
                                            <smokeklimit>{19}</smokeklimit>
                                             </vehispara>
            			                    </body>
                                            </root>",
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode,
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                m_mainform.testtimes,
                                objsj.fwendu.ToString("0.00"),
                                objsj.fdaqiya.ToString("0.00"),
                                objsj.fshidu.ToString("0.00"),
                                objsj.idlerev,
                                objsj.EngRev,
                                objsj.m_SKTurn4,//1
                                objsj.m_SKTurn3,//2
                                objsj.m_SKTurn2,//3
                                objsj.m_SKTurn,//4
                                objsj.SK4.ToString("0.00"),//1
                                objsj.SK1.ToString("0.00"),//2
                                objsj.SK2.ToString("0.00"),//3
                                objsj.SK3.ToString("0.00"),//4
                                objsj.fSKPJ.ToString("0.00"),
                                objsj.result,
                                objsj.smokeklimit);
            //检测结果
            string sjc005 = Write("JC005", vehispara, mainform.businessId);
            if (!sjc005.ToUpper().Contains("<CODE>1</CODE>"))
            {
                //m_mainform.baocunRJ("自由加速结果数据", vehispara); 
                //m_mainform.baocunRJ("自由加速结果数据结果", m_mainform.decode(sjc005)); 
                message = "上传自由加速结果数据失败 ";
                return message;
            }
            return message;
        }

        public override string  sjuploadLUG(string businessId, model.LUG.LUGsj objsj, model.LUG.LUGgcsj objgcsj, model.LUG.LUGobdgcsj objobdgcsj)
        {
            string message = "1";
            string cysx = "", btgclz = "", cs = "", zs = "", jzgl = "", gxsxs = "", zsgl = "", yw = "", glxzxs = "", jsgl = "", btgd = "",
                   dqyl = "", xdsd = "", hjwd = "", sjxl = "", nl = "", jczt = "", noxclz = "", co2clz = "", jcsj = "", gksj = "";
               
            string obdsjxl = "", jqmkd = "", fh = "", obdcs = "", qycgqxh = "", obdglkqxs = "", ymkd = "", fdjzs = "", jql = "",
                  jqyl = "", scgl = "", zyyl = "", hyl = "", no = "", nsbsl = "", pqwd = "", klbjqyc = "", egrkd = "", rypsyl = "";

            for (int i = 0; i < objgcsj.imaxcount; i++)
            {
                obdsjxl = obdsjxl + objobdgcsj.Obdsjxl[i] + ",";
                jqmkd = jqmkd + objobdgcsj.ObdThrottle[i] + ",";
                fh = fh + objobdgcsj.ObdCLV[i] + ",";
                qycgqxh = qycgqxh + objobdgcsj.ObdPreOxygen[i] + ",";
                obdglkqxs = obdglkqxs + objobdgcsj.ObdExcessAirFactor[i] + ",";
                ymkd = ymkd + objobdgcsj.Obdymkd[i] + ",";
                obdcs = obdcs + objobdgcsj.ObdSpeed[i] + ",";
                fdjzs = fdjzs + objobdgcsj.ObdRPM[i] + ",";
                jql = jql + objobdgcsj.ObdAirInput[i] + ",";
                jqyl = jqyl + objobdgcsj.ObdAirPressure[i] + ",";
                scgl = scgl + objobdgcsj.ObdPower[i] + ",";
                zyyl = zyyl + objobdgcsj.ObdBoostPressure[i] + ",";
                hyl = hyl + objobdgcsj.ObdFuelConsumption[i] + ",";
                no = no + objobdgcsj.ObdNOx[i] + ",";
                nsbsl = nsbsl + objobdgcsj.ObdSCR[i] + ",";
                pqwd = pqwd + objobdgcsj.ObdEGT[i] + ",";
                klbjqyc = klbjqyc + objobdgcsj.ObdDPF[i] + ",";
                egrkd = egrkd + objobdgcsj.ObdEGR[i] + ",";
                rypsyl = rypsyl + objobdgcsj.ObdEFI[i] + ",";
            }
            sjxl = sjxl.Trim(',');
            jqmkd = jqmkd.Trim(',');
            fh = fh.Trim(',');
            qycgqxh = qycgqxh.Trim(',');
            obdglkqxs = obdglkqxs.Trim(',');
            ymkd = ymkd.Trim(',');
            obdcs = obdcs.Trim(',');
            fdjzs = fdjzs.Trim(',');
            jql = jql.Trim(',');
            jqyl = jqyl.Trim(',');
            scgl = scgl.Trim(',');
            zyyl = zyyl.Trim(',');
            hyl = hyl.Trim(',');
            no = no.Trim(',');
            nsbsl = nsbsl.Trim(',');
            pqwd = pqwd.Trim(',');
            klbjqyc = klbjqyc.Trim(',');
            egrkd = egrkd.Trim(',');
            rypsyl = rypsyl.Trim(',');

            #region 老的数据处理
            for (int i = 0; i < objgcsj.imaxcount; i++)
            {
                if (i == 0)
                {
                    cysx = string.Format(@"{0}", i + 1);
                    btgclz = string.Format(@"{0}", objgcsj.m_SKGCSJmaxK[i]);
                    noxclz = string.Format(@"{0}", objgcsj.m_SKGCSJmaxNO[i]);
                    cs = string.Format(@"{0}", objgcsj.m_SKGCSJmaxSpeed[i]);
                    zs = string.Format(@"{0}", objgcsj.m_SKGCSJmaxTurn[i]);
                    jzgl = string.Format(@"{0}", Math.Abs(objgcsj.m_SKGCSJmaxPower[i]));
                    gxsxs = string.Format(@"{0}", objgcsj.m_SKGCSJmaxK[i]);
                    zsgl = string.Format(@"{0}", objgcsj.m_SKGCSJmaxPower[i]);
                    yw = string.Format(@"{0}", objgcsj.m_SKGCSJmaxyouwen[i]);
                    glxzxs = string.Format(@"{0}", objgcsj.m_SKGCSJmaxPowerK[i].ToString("0.0"));
                    jsgl = string.Format(@"{0}", 0.5);
                    btgd = string.Format(@"{0}", objgcsj.m_SKGCSJmaxK[i]);
                    dqyl = string.Format(@"{0}", objgcsj.m_SKGCSJmaxdaqiya[i]);
                    xdsd = string.Format(@"{0}", objgcsj.m_SKGCSJmaxshidu[i]);
                    hjwd = string.Format(@"{0}", objgcsj.m_SKGCSJmaxwendu[i]);
                    sjxl = string.Format(@"{0}", objgcsj.m_SKGCSJmaxTime[i]);
                    nl = string.Format(@"{0}", Math.Abs(objgcsj.m_SKGCSJmaxForce[i]));
                    jczt = string.Format(@"{0}", objgcsj.m_SKGCSJmaxjczt[i]);
                    co2clz = string.Format(@"{0}", objgcsj.m_SKGCSJmaxco2[i]);
                }
                else
                {
                    cysx = cysx + "," + string.Format(@"{0}", i + 1);
                    btgclz = btgclz + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxK[i]);
                    noxclz = noxclz + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxNO[i]);
                    cs = cs + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxSpeed[i]);
                    zs = zs + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxTurn[i]);
                    jzgl = jzgl + "," + string.Format(@"{0}", Math.Abs(objgcsj.m_SKGCSJmaxPower[i]));
                    gxsxs = gxsxs + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxK[i]);
                    zsgl = zsgl + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxPower[i]);
                    yw = yw + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxyouwen[i]);
                    glxzxs = glxzxs + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxPowerK[i].ToString("0.0"));
                    jsgl = jsgl + "," + string.Format(@"{0}", 0.5);
                    btgd = btgd + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxK[i]);
                    dqyl = dqyl + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxdaqiya[i]);
                    xdsd = xdsd + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxshidu[i]);
                    hjwd = hjwd + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxwendu[i]);
                    sjxl = sjxl + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxTime[i]);
                    nl = nl + "," + string.Format(@"{0}", Math.Abs(objgcsj.m_SKGCSJmaxForce[i]));
                    jczt = jczt + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxjczt[i]);

                    co2clz = co2clz + "," + string.Format(@"{0}", objgcsj.m_SKGCSJmaxco2[i]);
                }
            }
            #endregion

            #region 新数据处理
          /*  int k = 0;
            for (int i = 0; i < objgcsj.imaxcount; i++)
            {
                if (objgcsj.m_SKGCSJmaxjczt[i].Contains("0") && objgcsj.m_SKGCSJmaxPower[i] > 0)
                {
                    k = k + 1;
                    cysx = string.Format(@"{0}", k);
                    btgclz = string.Format(@"{0}", objgcsj.m_SKGCSJmaxK[i]);
                    noxclz = string.Format(@"{0}", objgcsj.m_SKGCSJmaxNO[i]);
                    cs = string.Format(@"{0}", objgcsj.m_SKGCSJmaxSpeed[i]);
                    zs = string.Format(@"{0}", objgcsj.m_SKGCSJmaxTurn[i]);
                    jzgl = string.Format(@"{0}", Math.Abs(objgcsj.m_SKGCSJmaxPower[i]));
                    gxsxs = string.Format(@"{0}", objgcsj.m_SKGCSJmaxK[i]);
                    zsgl = string.Format(@"{0}", objgcsj.m_SKGCSJmaxPower[i]);
                    yw = string.Format(@"{0}", objgcsj.m_SKGCSJmaxyouwen[i]);
                    glxzxs = string.Format(@"{0}", objgcsj.m_SKGCSJmaxPowerK[i].ToString("0.0"));
                    jsgl = string.Format(@"{0}", 0.5);
                    btgd = string.Format(@"{0}", objgcsj.m_SKGCSJmaxK[i]);
                    dqyl = string.Format(@"{0}", objgcsj.m_SKGCSJmaxdaqiya[i]);
                    xdsd = string.Format(@"{0}", objgcsj.m_SKGCSJmaxshidu[i]);
                    hjwd = string.Format(@"{0}", objgcsj.m_SKGCSJmaxwendu[i]);
                    sjxl = string.Format(@"{0}", objgcsj.m_SKGCSJmaxTime[i]);
                    nl = string.Format(@"{0}", Math.Abs(objgcsj.m_SKGCSJmaxForce[i]));
                    jczt = string.Format(@"{0}", objgcsj.m_SKGCSJmaxjczt[i]);
                    co2clz = string.Format(@"{0}", objgcsj.m_SKGCSJmaxco2[i]);
                }
                else if (!objgcsj.m_SKGCSJmaxjczt[i].Contains("0"))
                {
                    k = k + 1;
                    cysx = string.Format(@"{0}", k);
                    btgclz = string.Format(@"{0}", objgcsj.m_SKGCSJmaxK[i]);
                    noxclz = string.Format(@"{0}", objgcsj.m_SKGCSJmaxNO[i]);
                    cs = string.Format(@"{0}", objgcsj.m_SKGCSJmaxSpeed[i]);
                    zs = string.Format(@"{0}", objgcsj.m_SKGCSJmaxTurn[i]);
                    jzgl = string.Format(@"{0}", Math.Abs(objgcsj.m_SKGCSJmaxPower[i]));
                    gxsxs = string.Format(@"{0}", objgcsj.m_SKGCSJmaxK[i]);
                    zsgl = string.Format(@"{0}", objgcsj.m_SKGCSJmaxPower[i]);
                    yw = string.Format(@"{0}", objgcsj.m_SKGCSJmaxyouwen[i]);
                    glxzxs = string.Format(@"{0}", objgcsj.m_SKGCSJmaxPowerK[i].ToString("0.0"));
                    jsgl = string.Format(@"{0}", 0.5);
                    btgd = string.Format(@"{0}", objgcsj.m_SKGCSJmaxK[i]);
                    dqyl = string.Format(@"{0}", objgcsj.m_SKGCSJmaxdaqiya[i]);
                    xdsd = string.Format(@"{0}", objgcsj.m_SKGCSJmaxshidu[i]);
                    hjwd = string.Format(@"{0}", objgcsj.m_SKGCSJmaxwendu[i]);
                    sjxl = string.Format(@"{0}", objgcsj.m_SKGCSJmaxTime[i]);
                    nl = string.Format(@"{0}", Math.Abs(objgcsj.m_SKGCSJmaxForce[i]));
                    jczt = string.Format(@"{0}", objgcsj.m_SKGCSJmaxjczt[i]);
                    co2clz = string.Format(@"{0}", objgcsj.m_SKGCSJmaxco2[i]);
                }
            }
            */
            #endregion

            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                          m_mainform.organ,
                                                          m_mainform.jkxlh,
                                                          "GC011",
                                                          DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));

            vehispara = stoubao + string.Format(@"<body><vehispara>
                                            <jylsh>{0}</jylsh>
                                            <businessId>{1}</businessId>
                                            <registCode>{2}</registCode>
                                            <testtimes>{3}</testtimes>
                                            <cyds>{4}</cyds>
                                            <cysx>{5}</cysx>
                                            <sjxl>{6}</sjxl>
                                            <jqmkd>{7}</jqmkd>
                                            <fh>{8}</fh>
                                            <qycgqxh>{9}</qycgqxh>
                                            <glkqxs>{10}</glkqxs>
                                            <ymkd>{11}</ymkd>
                                            <cs>{12}</cs>
                                            <fdjzs>{13}</fdjzs>
                                            <jql>{14}</jql>
                                            <jqyl>{15}</jqyl>
                                            <scgl>{16}</scgl>
                                            <zyyl>{17}</zyyl>
                                            <hyl>{18}</hyl>
                                            <no>{19}</no>
                                            <nsbsl>{20}</nsbsl>
                                            <pqwd>{21}</pqwd>
                                            <klbjqyc>{22}</klbjqyc>
                                            <egrkd>{23}</egrkd>
                                            <rypsyl>{24}</rypsyl>
                                            <jczt>{25}</jczt>
                                             </vehispara>
            			                    </body>
                                            </root>",
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode,
                                m_mainform.testtimes,
                                objgcsj.imaxcount,
                                cysx,
                                obdsjxl,
                                jqmkd,
                                fh,
                                qycgqxh,
                                obdglkqxs,
                                ymkd,
                                obdcs,
                                fdjzs,
                                jql,
                                jqyl,
                                scgl,
                                zyyl,
                                hyl,
                                no,
                                nsbsl,
                                pqwd,
                                klbjqyc,
                                egrkd,
                                rypsyl,
                                jczt);
            //过程数据

            WebReferenceZHHB.WSServiceImplService m_vesd = new WebReferenceZHHB.WSServiceImplService();
            m_vesd.Url = m_mainform.surl;
            if (mainform.obdzt.Contains("有"))
            {
                string sgc011 = Write("GC011", vehispara, mainform.businessId);
                if (!sgc011.ToUpper().Contains("<CODE>1</CODE>"))
                {
                    //m_mainform.baocunRJ("OBD过程数据", vehispara);
                    //m_mainform.baocunRJ("OBD过程数据结果", m_mainform.decode(sgc011));
                    message = "上传OBD过程数据失败 ";
                    return message;
                }
            }
            vehispara = "";
            stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                           m_mainform.jkxlh,
                                                           "GC004",
                                                           DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            vehispara = stoubao + string.Format(@"<body><vehispara>
                                            <jylsh>{0}</jylsh>
                                            <registCode>{1}</registCode>
                                            <businessId>{2}</businessId>
                                            <testtimes>{3}</testtimes>
                                            <cyds>{4}</cyds>
                                            <cysx>{5}</cysx>
                                            <cs>{6}</cs>
                                            <zs>{7}</zs>
                                            <jzgl>{8}</jzgl>
                                            <gxsxs>{9}</gxsxs>
                                            <zsgl>{10}</zsgl>
                                            <yw>{11}</yw>
                                            <glxzxs>{12}</glxzxs>
                                            <jsgl>{13}</jsgl>
                                            <co2>{14}</co2>
                                            <btgd>{15}</btgd>
                                            <dqyl>{16}</dqyl>
                                            <xdsd>{17}</xdsd>
                                            <hjwd>{18}</hjwd>
                                            <sjxl>{19}</sjxl>
                                            <nl>{20}</nl>
                                            <noxclz>{21}</noxclz>
                                            <jczt>{22}</jczt>
                                             </vehispara>
            			                    </body>
                                            </root>",
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode,
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                m_mainform.testtimes,
                                objgcsj.imaxcount,
                                cysx,
                                cs,
                                zs,
                                jzgl,
                                gxsxs,
                                zsgl,
                                yw,
                                glxzxs,
                                jsgl,
                                co2clz,
                                btgd,
                                dqyl,
                                xdsd,
                                hjwd,
                                sjxl,
                                nl,
                                noxclz,
                                jczt);

            string sgc004 = Write("GC004", vehispara, mainform.businessId);
            if (!sgc004.ToUpper().Contains("<CODE>1</CODE>"))
            {

                //m_mainform.baocunRJ("LUG过程数据", vehispara); //
                //m_mainform.baocunRJ("LUG过程数据结果", m_mainform.decode(sgc004)); //
                message = "上传LUG过程数据失败 ";
                return message;
            }

            vehispara = "";
            stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                           m_mainform.jkxlh,
                                                           "JC004",
                                                           DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));

            vehispara = stoubao + string.Format(@"<body><vehispara>
                                            <jylsh>{0}</jylsh>
                                            <registCode>{1}</registCode>
                                            <businessId>{2}</businessId>
                                            <testtimes>{3}</testtimes>
                                            <wd>{4}</wd>
                                            <dqy>{5}</dqy>
                                            <xdsd>{6}</xdsd>
                                            <velmaxhp>{7}</velmaxhp>
                                            <rev100>{8}</rev100>
                                            <maxpower>{9}</maxpower>
                                            <maxpowerlimit>{10}</maxpowerlimit>
                                            <zdlbglzs>{11}</zdlbglzs>
                                            <zdlbgljudge>{12}</zdlbgljudge>
                                            <smokeklimit>{13}</smokeklimit>
                                            <ydjudge>{14}</ydjudge>
                                            <k100>{15}</k100>
                                            <k80>{16}</k80>
                                            <nox>{17}</nox>
                                            <noxlimit>{18}</noxlimit>
                                            <raterevup>{19}</raterevup>
                                            <raterevdown>{20}</raterevdown>
                                            <result>{21}</result>
                                             </vehispara>
            			                    </body>
                                            </root>",
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode,
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                m_mainform.testtimes,
                                objsj.fwendu.ToString("0.00"),
                                objsj.fdaqiya.ToString("0.00"),
                                objsj.fshidu.ToString("0.00"),
                                objsj.zdlbglsjxsd,
                                objsj.zdlbglfdjzs,
                                objsj.fFindMaxPower.ToString("0.0"),
                                (objsj.fiedgl*0.4).ToString(),
                                objsj.zdlbglfdjzs,
                                objsj.fFindMaxPower > (objsj.fiedgl * 0.4) ? "1":"0",
                                m_mainform.TypeApprovalLimits,
                                (objsj.m_sk100 > m_mainform.TypeApprovalLimits ||objsj.m_sk80 > m_mainform.TypeApprovalLimits)?"0":"1",
                                objsj.m_sk100.ToString("0.00"),
                                objsj.m_sk80.ToString("0.00"),
                                objsj.m_sno80,
                                m_mainform.noxlimit,
                                objsj.raterevup,
                                objsj.raterevdown,
                                objsj.bgood?"1":"0");
            //检测结果
            string sjc004 = Write("JC004", vehispara, mainform.businessId);
            if (!sjc004.ToUpper().Contains("<CODE>1</CODE>"))
            {
                //m_mainform.baocunRJ("LUG结果数据", vehispara); //
                //m_mainform.baocunRJ("LUG结果数据结果", m_mainform.decode(sjc004)); //
                message = "上传LUG结果数据失败 ";
                return message;
            }
            return message;
        }

        public override string sendOBDGC(联网通信协议.安车model.GC011 gc011)
        {
            string message = "";

            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                          m_mainform.organ,
                                                          m_mainform.jkxlh,
                                                          "GC011",
                                                          DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));

            vehispara = stoubao + string.Format(@"<body><vehispara>
                                <jylsh>{0}</jylsh>
                                <businessId>{1}</businessId>
                                <registCode>{2}</registCode>
                                <testtimes>{3}</testtimes>
                                <cyds>{4}</cyds>
                                <cysx>{5}</cysx>
                                <sjxl>{6}</sjxl>
                                <jqmkd>{7}</jqmkd>
                                <fh>{8}</fh>
                                <qycgqxh>{9}</qycgqxh>
                                <glkqxs>{10}</glkqxs>
                                <ymkd>{11}</ymkd>
                                <cs>{12}</cs>
                                <fdjzs>{13}</fdjzs>
                                <jql>{14}</jql>
                                <jqyl>{15}</jqyl>
                                <scgl>{16}</scgl>
                                <zyyl>{17}</zyyl>
                                <hyl>{18}</hyl>
                                <no>{19}</no>
                                <nsbsl>{20}</nsbsl>
                                <pqwd>{21}</pqwd>
                                <klbjqyc>{22}</klbjqyc>
                                <egrkd>{23}</egrkd>
                                <rypsyl>{24}</rypsyl>
                                <jczt>{25}</jczt>
                                 </vehispara>
			                    </body>
                                </root>",
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode,
                                m_mainform.testtimes,
                                gc011.cyds,
                                gc011.cysx,
                                gc011.sjxl,
                                gc011.jqmkd,
                                gc011.fh,
                                gc011.qycgqxh,
                                gc011.glkqxs,
                                gc011.ymkd,
                                gc011.cs,
                                gc011.fdjzs,
                                gc011.jql,
                                gc011.jqyl,
                                gc011.scgl,
                                gc011.zyyl,
                                gc011.hyl,
                                gc011.no,
                                gc011.nsbsl,
                                gc011.pqwd,
                                gc011.klbjqyc,
                                gc011.egrkd,
                                gc011.rypsyl,
                                gc011.jczt);
            //过程数据
            string sgc011 = Write("GC011", vehispara, mainform.businessId);
            if (!sgc011.ToUpper().Contains("<CODE>1</CODE>"))
            {
                //m_mainform.baocunRJ("OBD过程数据", vehispara);
                //m_mainform.baocunRJ("OBD过程数据结果", m_mainform.decode(sgc011));
                message = "上传OBD过程数据失败 ";
                return message;
            }
            return message;
        }//obd过程
        

        public override string uploadhxjc(model.尾气自检.hxjc objhxjc)// //加载滑行检查(ZJ000-01)附加功率(ZJ000-02)
        {
            string jkid = "ZJ000_01";//jkid需要增加条件判断
            string zjlx = "01";
            string sdqj1 = "50-30";
            string sdqj2 = "35-15";
            if (objhxjc.scyqy.Contains("2"))
            {
                sdqj1 = "80-60";
                sdqj2 = "60-40";
            }
            if (objhxjc.zjlx.Contains("2"))
            {
                jkid = "ZJ000_02";
                zjlx = "02";
            }
                string vehispara = "";
                string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
                stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                               m_mainform.organ,
                                                               m_mainform.jkxlh,
                                                               jkid,
                                                               DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
                if (jkid.Contains("01"))
                {
                    vehispara = stoubao + string.Format(@"<body><vehispara>
                                <tsno>{0}</tsno>
                                <testlineno>{1}</testlineno>
                                <registCode>{2}</registCode>
                                <businessId>{3}</businessId>
                                <zjlx>{4}</zjlx>
                                <cgjlx>{5}</cgjlx>
                                <sdqj1>{6}</sdqj1>
			                    <sdqj2>{7}</sdqj2>
			                    <jcrq>{8}</jcrq>
			                    <jckssj>{9}</jckssj>
                                <sjhxsj1>{10}</sjhxsj1>
			                    <sjhxsj2>{11}</sjhxsj2>
                                <ns1>{12}</ns1>
                                <ns2>{13}</ns2>
                                <myhxsj1>{14}</myhxsj1>
                                <myhxsj2>{15}</myhxsj2>
			                    <zsgl1>{16}</zsgl1>
                                <zsgl2>{17}</zsgl2>
                                <jbgl>{18}</jbgl>
                                <jcjg1>{19}</jcjg1>
                                <jcjg2>{20}</jcjg2>
                                <jcjg>{21}</jcjg>
                                <jcry>{22}</jcry>
                                </vehispara>
			                    </body>
                                </root>",
                                 m_mainform.stationCode,
                                 m_mainform.lineCode,
                                 mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode,
                                 mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                 zjlx,
                                 objhxjc.scyqy,
                                 sdqj1,
                                 sdqj2,
                                 DateTime.Now.ToString("yyyy-MM-dd"),
                                 objhxjc.dtBeginTime,
                                 float.Parse(objhxjc.ActualTime25).ToString("0.000"),
                                 float.Parse(objhxjc.ActualTime40).ToString("0.000"),
                                 float.Parse(objhxjc.fLossPW25).ToString("0.00"),
                                 float.Parse(objhxjc.fLossPW40).ToString("0.00"),
                                 float.Parse(objhxjc.TheoretialTime25).ToString("0.000"),
                                 float.Parse(objhxjc.TheoretialTime40).ToString("0.000"),
                                 objhxjc.fPowerI.Length < 1 ? "1" : float.Parse(objhxjc.fPowerI).ToString("0.00"),
                                 objhxjc.fPowerI.Length < 1 ? "1" : float.Parse(objhxjc.fPowerI).ToString("0.00"),
                                 float.Parse(objhxjc.fDIW).ToString("0.00"),
                                 objhxjc.JudgeResult25,
                                 objhxjc.JudgeResult40,
                                 objhxjc.nJudgeResult,
                                objhxjc.Checker.Length < 1 ? "蒋佩" : objhxjc.Checker);
                }
                else
                {
                    vehispara = stoubao + string.Format(@"<body><vehispara>
                                 <tsno>{0}</tsno>
                                 <testlineno>{1}</testlineno>
                                 <registCode>{2}</registCode>
                                 <zjlx>{3}</zjlx>
                                 <cgjlx>{4}</cgjlx>
                                 <sdqj1>{5}</sdqj1>
                                 <sdqj2>{6}</sdqj2>
                                 <jcrq>{7}</jcrq>
                                 <jckssj>{8}</jckssj>
                                 <jcjssj>{9}</jcjssj>
                                 <sjhxsj1>{10}</sjhxsj1>
                                 <sjhxsj2>{11}</sjhxsj2>
                                 <ns1>{12}</ns1>
                                 <ns2>{13}</ns2>
                                 <jbgl>{14}</jbgl>
                                 <jcjg>{15}</jcjg>
                                 <jcry>{16}</jcry>
                                 </vehispara>
                                 </body>
                                 </root>",
                         m_mainform.stationCode,
                         m_mainform.lineCode,
                         mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode,
                         "02",
                         objhxjc.scyqy,
                         sdqj1,
                         sdqj2,
                         DateTime.Now.ToString("yyyy-MM-dd"),
                         objhxjc.dtBeginTime,
                         objhxjc.dtEndTime,
                         float.Parse(objhxjc.ActualTime25).ToString("0.000"),
                         float.Parse(objhxjc.ActualTime40).ToString("0.000"),
                         float.Parse(objhxjc.fLossPW25).ToString("0.00"),
                         float.Parse(objhxjc.fLossPW40).ToString("0.00"),
                         float.Parse(objhxjc.fDIW).ToString("0.00"),
                         objhxjc.nJudgeResult,
                         objhxjc.Checker.Length < 1 ? "蒋佩" : objhxjc.Checker);
                }

                string sgc005 = Write(jkid, vehispara, mainform.businessId);
                return sgc005;
        }

        public override string uploadzj(model.尾气自检.fqyddjc objxljc)//分析仪检查(ZJ000-03)//底标气检查 (ZJ000-06) //(BD000-05)
        {
            var jkid = "ZJ000_03";
            var zjlx = "03";
            string str = "";
            string sgc005 = "";
            if (objxljc.Checkkind.Contains("检查"))//检定          
            {
                if (objxljc.CheckTypeex.Contains("中低浓度"))
                {
                    str = "2";
                }
                else if (objxljc.CheckTypeex.Contains("低浓度"))
                {
                    str = "1";
                    jkid = "ZJ000_06";
                    zjlx = "06";
                }
                else if (objxljc.CheckTypeex.Contains("中高浓度"))
                {
                    str = "3";
                }
                else if (objxljc.CheckTypeex.Contains("高浓度"))
                {
                    str = "4";
                }
                else if (objxljc.CheckTypeex.Contains("零度"))
                {
                    str = "5";
                }
                else
                {
                    str = "1";
                }

                string vehispara = "";
                string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
                stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                               m_mainform.organ,
                                                               m_mainform.jkxlh,
                                                               jkid,
                                                               DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
                vehispara = stoubao + string.Format(@"<body><vehispara>
                                <tsno>{0}</tsno>
                                <testlineno>{1}</testlineno>
                                <registCode>{2}</registCode>
                                <zjlx>{3}</zjlx>
                                <jcrq>{4}</jcrq>
                                <jclx>{5}</jclx>
			                    <jckssj>{6}</jckssj>
                                <c3h8nd>{7}</c3h8nd>
                                <cond>{8}</cond>
			                    <co2nd>{9}</co2nd>			                    
			                    <nond>{10}</nond>
			                    <o2nd>{11}</o2nd>
                                <hcjcz>{12}</hcjcz>
                                <cojcz>{13}</cojcz>
                                <co2jcz>{14}</co2jcz>
                                <nojcz>{15}</nojcz>
                                <o2jcz>{16}</o2jcz>		                    			                    			                    			                    		                   
			                    <pef>{17}</pef>
			                    <jcjg>{18}</jcjg>
			                    <jcry>{19}</jcry>
                                 </vehispara>
			                    </body>
                                </root>",
                             m_mainform.stationCode,
                             m_mainform.lineCode,
                             mainform.registCode,
                             zjlx,
                             DateTime.Now.ToString("yyyy-MM-dd"),
                             str,
                             objxljc.dtBeginTime,
                             float.Parse(objxljc.C3H8).ToString("0.00"),
                             float.Parse(objxljc.StdValCO).ToString("0.00"),
                             float.Parse(objxljc.StdValCO2).ToString("0.00"),
                             float.Parse(objxljc.StdValNO).ToString("0.00"),
                             float.Parse(objxljc.StdValO2).ToString("0.00"),
                             float.Parse(objxljc.CheckValHC).ToString("0.00"),
                             float.Parse(objxljc.CheckValCO).ToString("0.00"),
                             float.Parse(objxljc.CheckValCO2).ToString("0.00"),
                             float.Parse(objxljc.CheckValNO).ToString("0.00"),
                             float.Parse(objxljc.CheckValO2).ToString("0.00"),
                             float.Parse(objxljc.PEF).ToString("0.000"),
                             "1",
                             m_mainform.sczyxx.Length < 1 ? "蒋佩" : m_mainform.sczyxx);

                sgc005 = Write(jkid, vehispara, mainform.businessId);

                if (jkid.Contains("06"))//气体为底标时，也上传 ZJ000_03
                {
                    jkid = "ZJ000_03";
                    zjlx = "03";
                    stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
                    stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                                   m_mainform.organ,
                                                                   m_mainform.jkxlh,
                                                                   jkid,
                                                                   DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
                    vehispara = stoubao + string.Format(@"<body><vehispara>
                                <tsno>{0}</tsno>
                                <testlineno>{1}</testlineno>
                                <registCode>{2}</registCode>
                                <zjlx>{3}</zjlx>
                                <jcrq>{4}</jcrq>
                                <jclx>{5}</jclx>
			                    <jckssj>{6}</jckssj>
                                <c3h8nd>{7}</c3h8nd>
                                <cond>{8}</cond>
			                    <co2nd>{9}</co2nd>			                    
			                    <nond>{10}</nond>
			                    <o2nd>{11}</o2nd>
                                <hcjcz>{12}</hcjcz>
                                <cojcz>{13}</cojcz>
                                <co2jcz>{14}</co2jcz>
                                <nojcz>{15}</nojcz>
                                <o2jcz>{16}</o2jcz>		                    			                    			                    			                    		                   
			                    <pef>{17}</pef>
			                    <jcjg>{18}</jcjg>
			                    <jcry>{19}</jcry>
                                 </vehispara>
			                    </body>
                                </root>",
                                 m_mainform.stationCode,
                                 m_mainform.lineCode,
                                 mainform.registCode,
                                 zjlx,
                                 DateTime.Now.ToString("yyyy-MM-dd"),
                                 str,
                                 objxljc.dtBeginTime,
                                 float.Parse(objxljc.C3H8).ToString("0.00"),
                                 float.Parse(objxljc.StdValCO).ToString("0.00"),
                                 float.Parse(objxljc.StdValCO2).ToString("0.00"),
                                 float.Parse(objxljc.StdValNO).ToString("0.00"),
                                 float.Parse(objxljc.StdValO2).ToString("0.00"),
                                 float.Parse(objxljc.CheckValHC).ToString("0.00"),
                                 float.Parse(objxljc.CheckValCO).ToString("0.00"),
                                 float.Parse(objxljc.CheckValCO2).ToString("0.00"),
                                 float.Parse(objxljc.CheckValNO).ToString("0.00"),
                                 float.Parse(objxljc.CheckValO2).ToString("0.00"),
                                 float.Parse(objxljc.PEF).ToString("0.000"),
                                 "1",
                                 m_mainform.sczyxx.Length < 1 ? "蒋佩" : m_mainform.sczyxx);

                    sgc005 = Write(jkid, vehispara, mainform.businessId);
                }
            }
            else
            {
                string bdnr = string.Format(@"
             <bdnr>
             <lx>1</lx>                
            <bzc3h8>{0}</bzc3h8>      
            <kssj>{1}</kssj>
            <jssj>{2}</jssj>
            <sdzhc1>{3}</sdzhc1>                 
            <sczhc1>{4}</sczhc1>                
            <jdwczhc1>2</jdwczhc1>               
            <xdwczhc1>1.84</xdwczhc1>           
            <sdzhc2>1654</sdzhc2>                
            <sczhc2>1658</sczhc2>                
            <jdwczhc2>1</jdwczhc2>               
            <xdwczhc2>1.02</xdwczhc2>            
            <sdzco1>0.497</sdzco1>               
            <sczco1>0.49</sczco1>                
            <jdwczco1>1.41</jdwczco1>            
            <xdwczco1>1.01</xdwczco1>            
            <sdzco2>8.0</sdzco2>                 
            <sczco2>8.01</sczco2>                
            <jdwczco2>1.41</jdwczco2>            
            <xdwczco2>1.01</xdwczco2>            
            <sdzco21>3.57</sdzco21>              
            <sczco21>3.45</sczco21>              
            <jdwczco21>5.33</jdwczco21>          
            <xdwczco21>3.36</xdwczco21>          
            <sdzco22>12.0</sdzco22>             
            <sczco22>12.02</sczco22>             
            <jdwczco22>5.33</jdwczco22>          
            <xdwczco22>3.36</xdwczco22>         
            <sdzno1>296</sdzno1>                 
            <sczno1>292</sczno1>                 
            <jdwczno1>1.35</jdwczno1>            
            <xdwczno1>1.25</xdwczno1>            
            <sdzno2>3000</sdzno2>                
            <sczno2>3070</sczno2>                
            <jdwczno2>1.35</jdwczno2>           
            <xdwczno2>1.25</xdwczno2>           
            <pef>0.89</pef>                          
            <jcjg>1</jcjg>
            </bdnr>",
           objxljc.C3H8,
           DateTime.Now.AddMinutes(-5).ToString("yyyy-MM-dd HH:mm:ss.fff"),
           DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"),
           objxljc.StdValHC,
           objxljc.CheckValHC,
           objxljc.DivValHC,
           objxljc.RateValHC,
           objxljc.StdValHC,
           objxljc.CheckValHC,
           objxljc.DivValHC,
           objxljc.RateValHC,
           objxljc.StdValCO,
           objxljc.CheckValCO,
           objxljc.DivValCO,
           objxljc.RateValCO,
           objxljc.StdValCO,
           objxljc.CheckValCO,
           objxljc.DivValCO,
           objxljc.RateValCO,
           objxljc.StdValCO2,
           objxljc.CheckValCO2,
           objxljc.DivValCO2,
           objxljc.RateValCO2,
           objxljc.StdValCO2,
           objxljc.CheckValCO2,
           objxljc.DivValCO2,
           objxljc.RateValCO2,
           objxljc.StdValNO,
           objxljc.CheckValNO,
           objxljc.DivValNO,
           objxljc.RateValNO,
           objxljc.StdValNO,
           objxljc.CheckValNO,
           objxljc.DivValNO,
           objxljc.RateValNO,
           objxljc.PEF,
           "1");
                string vehispara = "";
                string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
                stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                               m_mainform.organ,
                                                               m_mainform.jkxlh,
                                                               "BD000",
                                                                DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
                vehispara = stoubao + string.Format(@"<body><vehispara>
                                <sbbh>{0}</sbbh>
                                <registCode>{1}</registCode>
                                <businessId>{2}</businessId>
                                <bdsj>{3}</bdsj>
                                <bdr>{4}</bdr>
                                <czr>{5}</czr>
                                <bdlx>{6}</bdlx>
                                <bdnrs>{7}</bdnrs>
                                <bdjg>{8}</bdjg>
                                <tsno>{9}</tsno>
                                <testlineno>{10}</testlineno>              
                                 </vehispara>
			                    </body>
                                </root>",
                                m_mainform.scysbbh,
                                mainform.registCode,
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                                m_mainform.sczyxx.Length < 1 ? "蒋佩" : m_mainform.sczyxx,
                                m_mainform.sczyxx.Length < 1 ? "蒋佩" : m_mainform.sczyxx,
                                "05",
                                bdnr,
                                "1",
                                m_mainform.stationCode,
                                m_mainform.lineCode);

                sgc005 = Write("BD000_05", vehispara, mainform.businessId);

               
            }

            return sgc005;
        }

        public override string uploadzj(model.尾气自检.xljc objxljc)//泄漏(ZJ000-04)
        {
            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                           m_mainform.jkxlh,
                                                           "ZJ000_04",
                                                           DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            vehispara = stoubao + string.Format(@"<body><vehispara>
                                <tsno>{0}</tsno>
                                <testlineno>{1}</testlineno>
                                <zjlx>{2}</zjlx>
                                <jcrq>{3}</jcrq>
                                <jckssj>{4}</jckssj>
			                    <jcjg>{5}</jcjg>
                                <jcry>{6}</jcry>	
                                <registCode>{7}</registCode>
                                <businessId>{8}</businessId>	                   
                                 </vehispara>
			                    </body>
                                </root>",
                         m_mainform.stationCode,
                         m_mainform.lineCode,
                         "04",
                         objxljc.dtCheckDate,
                         objxljc.dtBeginTime,
                         objxljc.nJudegeResult,
                         objxljc.jcry.Length < 1 ? "蒋佩" : objxljc.jcry,
                         mainform.registCode,
                         mainform.businessId.Length < 1 ? "1" : mainform.businessId);

            string sgc005= Write("ZJ000_04", vehispara, mainform.businessId);
            return sgc005;
        }

        public override string uploadzj(model.尾气自检.yliangcheng objxljc)//氧量程(ZJ000-05)
        {
            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                           m_mainform.jkxlh,
                                                           "ZJ000_05",
                                                           DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            vehispara = stoubao + string.Format(@"<body><vehispara>
                                <tsno>{0}</tsno>
                                <testlineno>{1}</testlineno>
                                <registCode>{2}</registCode>
                                <zjlx>{3}</zjlx>
                                <jcrq>{4}</jcrq>
                                <jckssj>{5}</jckssj>
			                    <o2lcbz>{6}</o2lcbz>
			                    <o2lcclz>{7}</o2lcclz>
			                    <o2lcwc>{8}</o2lcwc>
			                    <jcjg>{9}</jcjg>	
                                <jcry>{10}</jcry>		                   
                                 </vehispara>
			                    </body>
                                </root>",
                         m_mainform.stationCode,
                         m_mainform.lineCode,
                         mainform.registCode,
                         "05",
                         objxljc.dtCheckDate,
                         objxljc.dtBeginTime,
                         float.Parse(objxljc.StdVal).ToString("0.00"),
                         float.Parse(objxljc.CheckVal).ToString("0.00"),
                         float.Parse(objxljc.DivVal).ToString("0.00"),
                         objxljc.nJudgeResult.Contains("合格")?"1":"0",
                         m_mainform.sczyxx.Length < 1 ? "蒋佩" : m_mainform.sczyxx);

            string sgc005 = Write("ZJ000_05", vehispara, mainform.businessId);
            return sgc005;
        }

        public override string uploadzj(model.尾气自检.dzqxzzijian objxljc)//电子环境信息检查(ZJ000-08)
        {

            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                          m_mainform.jkxlh,
                                                           "ZJ000_08",
                                                           DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));

            vehispara = stoubao + string.Format(@"<body><vehispara>
                                <tsno>{0}</tsno>
                                <testlineno>{1}</testlineno>
                                <registCode>{2}</registCode>
                                <zjlx>{3}</zjlx>
                                <jcrq>{4}</jcrq>
                                <jckssj>{5}</jckssj>
			                    <jcjssj>{6}</jcjssj>
			                    <txjc>{7}</txjc>
			                    <hjwd>{8}</hjwd>
			                    <yqwd>{9}</yqwd>
			                    <hjsd>{10}</hjsd>
			                    <yqsd>{11}</yqsd>
			                    <hjqy>{12}</hjqy>
			                    <yqqy>{13}</yqqy>
			                    <jcjg>{14}</jcjg>
                                <jcry>{15}</jcry>
                                </vehispara>
			                    </body>
                                </root>",
                         m_mainform.stationCode,
                         m_mainform.lineCode,
                         mainform.registCode,
                        "08",
                        objxljc.dtCheckDate,
                        objxljc.dtBeginTime,
                        objxljc.dtEndTime,
                        "1",
                        float.Parse(objxljc.CheckTempVal).ToString("0.00"),//环境
                        float.Parse(objxljc.StdTempVal).ToString("0.00"),
                        float.Parse(objxljc.CheckPressVal).ToString("0.00"),//环境
                        float.Parse(objxljc.StdHumiVal).ToString("0.00"),
                        float.Parse(objxljc.CheckHumiVal).ToString("0.00"),//环境
                        float.Parse(objxljc.StdPressVal).ToString("0.00"),
                        objxljc.nJudegeResult,
                        objxljc.jcry.Length < 1 ? "蒋佩" : objxljc.jcry);

            string sgc005 = Write("ZJ000_08", vehispara, mainform.businessId);
            return sgc005;
        }

        public override string uploadzj(model.尾气自检.btgnoxyqjd objxljc)//氮氧化物分析仪检查(ZJ000-09)
        {
            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                          m_mainform.jkxlh,
                                                           "ZJ000_09",
                                                            DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            vehispara = stoubao + string.Format(@"<body><vehispara>
                                <tsno>{0}</tsno>
                                <testlineno>{1}</testlineno>
                                <registCode>{2}</registCode>
                                <zjlx>{3}</zjlx>
                                <jcrq>{4}</jcrq>
                                <jckssj>{5}</jckssj>
                                <jcjssj>{6}</jcjssj>
                                <co2nd>{7}</co2nd>
                                <nond>{8}</nond>
                                <no2nd>{9}</no2nd>
                                <co2jcz>{10}</co2jcz>
                                <nojcz>{11}</nojcz>
                                <no2jcz>{12}</no2jcz>
                                <jcjg>{13}</jcjg>
			                    <jcry>{14}</jcry>		                   
                                 </vehispara>
			                    </body>
                                </root>",
                                 m_mainform.stationCode,
                                 m_mainform.lineCode,
                                 mainform.registCode,
                                 "09",
                                 objxljc.dtCheckDate,
                                 objxljc.dtBeginTime,
                                 objxljc.dtEndTime,
                                 float.Parse(objxljc.StdValCO2).ToString("0.00"),
                                 float.Parse(objxljc.StdValNO).ToString("0.00"),
                                 float.Parse(objxljc.StdValNO2).ToString("0.00"),
                                 float.Parse(objxljc.CheckValCO2).ToString("0.00"),
                                 float.Parse(objxljc.CheckValNO).ToString("0.00"),
                                 float.Parse(objxljc.CheckValNO2).ToString("0.00"),
                                "1",
                                objxljc.Checker.Length < 1 ? "蒋佩" : objxljc.Checker);

            string sgc005 = Write("ZJ000_09", vehispara, mainform.businessId);
            return sgc005;
        }

        public override string uploadzj(model.尾气自检.btgydjjc objzjsj)//烟度校准 BD000 6
        {
            string bdnr = string.Format(@"
            <bdnr>
            <btgydsdz1>{0}</btgydsdz1>
            <btgydscz1>{1}</btgydscz1>
            <btgydwcz1>{2}</btgydwcz1>
            <btgydsdz2>{3}</btgydsdz2>
            <btgydscz2>{4}</btgydscz2>
            <btgydwcz2>{5}</btgydwcz2>
            <btgydsdz3>{6}</btgydsdz3>
            <btgydscz3>{7}</btgydscz3>
            <btgydwcz3>{8}</btgydwcz3>
            </bdnr>",
            objzjsj.CheckVal0,
            objzjsj.StdVal0,
            objzjsj.AbssoluteVal0,
            objzjsj.CheckVal100,
            objzjsj.StdVal100,
            objzjsj.AbssoluteVal100,
            objzjsj.CheckVal100,
            objzjsj.StdVal100,
            objzjsj.AbssoluteVal100);
            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                           m_mainform.jkxlh,
                                                           "BD000",
                                                            DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            vehispara = stoubao + string.Format(@"<body><vehispara>
                                <sbbh>{0}</sbbh>
                                <registCode>{1}</registCode>
                                <businessId>{2}</businessId>
                                <bdsj>{3}</bdsj>
                                <bdr>{4}</bdr>
                                <czr>{5}</czr>
                                <bdlx>{6}</bdlx>
                                <bdnrs>{7}</bdnrs>
                                <bdjg>{8}</bdjg>
                                <tsno>{9}</tsno>
                                <testlineno>{10}</testlineno>              
                                 </vehispara>
			                    </body>
                                </root>",
                                 m_mainform.scysbbh,
                                 mainform.registCode,
                                 mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                 DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                                 m_mainform.sczyxx.Length < 1 ? "蒋佩" : m_mainform.sczyxx,
                                 m_mainform.sczyxx.Length < 1 ? "蒋佩" : m_mainform.sczyxx,
                                 "06",
                                 bdnr,
                                 "1",
                                 m_mainform.stationCode,
                                 m_mainform.lineCode);

            string sgc005 = Write("BD000_06", vehispara, mainform.businessId);

            return sgc005;
        }

        public override string uploadzj(model.尾气自检.fjgl objfjgl)//汽油附加功率(ZJ002)
        {
            string jkid = "ZJ000_02";//jkid需要增加条件判断
            string sdqj1 = "50-30";
            string sdqj2 = "35-15";
            if (objfjgl.scyqy.Contains("2"))
            {
                sdqj1 = "80-60";
                sdqj2 = "60-40";
            }
            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                           m_mainform.jkxlh,
                                                           jkid,
                                                           DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            {
                vehispara = stoubao + string.Format(@"<body><vehispara>
                                 <tsno>{0}</tsno>
                                 <testlineno>{1}</testlineno>
                                 <registCode>{2}</registCode>
                                 <zjlx>{3}</zjlx>
                                 <cgjlx>{4}</cgjlx>
                                 <sdqj1>{5}</sdqj1>
                                 <sdqj2>{6}</sdqj2>
                                 <jcrq>{7}</jcrq>
                                 <jckssj>{8}</jckssj>
                                 <jcjssj>{9}</jcjssj>
                                 <sjhxsj1>{10}</sjhxsj1>
                                 <sjhxsj2>{11}</sjhxsj2>
                                 <ns1>{12}</ns1>
                                 <ns2>{13}</ns2>
                                 <jbgl>{14}</jbgl>
                                 <jcjg>{15}</jcjg>
                                 <jcry>{16}</jcry>
                                 </vehispara>
                                 </body>
                                 </root>",
                     m_mainform.stationCode,
                     m_mainform.lineCode,
                     mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode,
                     "02",
                     objfjgl.scyqy,
                     sdqj1,
                     sdqj2,
                     DateTime.Now.ToString("yyyy-MM-dd"),
                     objfjgl.PLTimeStart,
                     objfjgl.SlideTimeEnd,
                     float.Parse(objfjgl.ACDT25).ToString("0.000"),
                     float.Parse(objfjgl.ACDT40).ToString("0.000"),
                     float.Parse(objfjgl.PLHP25).ToString("0.00"),
                     float.Parse(objfjgl.PLHP40).ToString("0.00"),
                     float.Parse(objfjgl.DIW).ToString("0.00"),
                     1,
                     objfjgl.Checker.Length < 1 ? "蒋佩" : objfjgl.Checker);
            }

            string sgc005 = Write(jkid, vehispara, mainform.businessId);
            return sgc005;
        
        
        }

        public override string uploadzj(model.尾气自检.cyfjgl objxljc)//柴油附加功率检查(ZJ000-02)
        {
            string jkid = "ZJ000_02";//jkid需要增加条件判断
            string zjlx = "02";
            string sdqj1 = "80-60";
            string sdqj2 = "60-40";


            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                           m_mainform.jkxlh,
                                                           jkid,
                                                           DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            {
                vehispara = stoubao + string.Format(@"<body><vehispara>
                                 <tsno>{0}</tsno>
                                 <testlineno>{1}</testlineno>
                                 <registCode>{2}</registCode>
                                 <zjlx>{3}</zjlx>
                                 <cgjlx>{4}</cgjlx>
                                 <sdqj1>{5}</sdqj1>
                                 <sdqj2>{6}</sdqj2>
                                 <jcrq>{7}</jcrq>
                                 <jckssj>{8}</jckssj>
                                 <jcjssj>{9}</jcjssj>
                                 <sjhxsj1>{10}</sjhxsj1>
                                 <sjhxsj2>{11}</sjhxsj2>
                                 <ns1>{12}</ns1>
                                 <ns2>{13}</ns2>
                                 <jbgl>{14}</jbgl>
                                 <jcjg>{15}</jcjg>
                                 <jcry>{16}</jcry>
                                 </vehispara>
                                 </body>
                                 </root>",
                     m_mainform.stationCode,
                     m_mainform.lineCode,
                     mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode,
                     "02",
                     "2",
                     sdqj1,
                     sdqj2,
                     DateTime.Now.ToString("yyyy-MM-dd"),
                     objxljc.PLTimeStart,
                     objxljc.SlideTimeEnd,
                     float.Parse(objxljc.ACDT70).ToString("0.000"),
                     float.Parse(objxljc.ACDT40).ToString("0.000"),
                     float.Parse(objxljc.ACDT50).ToString("0.00"),
                     float.Parse(objxljc.PLHP50).ToString("0.00"),
                     float.Parse(objxljc.DIW).ToString("0.00"),
                     "1",
                     objxljc.Checker.Length < 1 ? "蒋佩" : objxljc.Checker);
            }

            string sgc005 = Write(jkid, vehispara, mainform.businessId);
            return sgc005;
        }

        public override string uploadzj(string tph, model.尾气自检.cyhxsj objxljc)//9.30	上报柴油车底盘测功机滑行检查记录表
        {
            string jkid = "ZJ000_01";//jkid需要增加条件判断
            string zjlx = "01";
            string sdqj1 = "80-60";
            string sdqj2 = "60-40";
            string sjhxsj1 = "1";
            string sjhxsj2 = "1";
            string sjhxll1 = "1";
            string sjhxll2 = "1";
            if (tph.Contains("10"))
            {
                sjhxsj1 = float.Parse(objxljc.IHP10ACDT70).ToString("0.000");
                sjhxsj2 = float.Parse(objxljc.IHP10ACDT50).ToString("0.000");
                sjhxll1 = float.Parse(objxljc.IHP10CCDT70).ToString("0.000");
                sjhxll2 = float.Parse(objxljc.IHP10CCDT50).ToString("0.000");
            }
            else if (tph.Contains("20"))
            {
                sjhxsj1 = float.Parse(objxljc.IHP20ACDT70).ToString("0.000");
                sjhxsj2 = float.Parse(objxljc.IHP20ACDT50).ToString("0.000");
                sjhxll1 = float.Parse(objxljc.IHP20CCDT70).ToString("0.000");
                sjhxll2 = float.Parse(objxljc.IHP20CCDT50).ToString("0.000");
            }
            else if (tph.Contains("30"))
            {
                sjhxsj1 = float.Parse(objxljc.IHP30ACDT70).ToString("0.000");
                sjhxsj2 = float.Parse(objxljc.IHP30ACDT50).ToString("0.000");
                sjhxll1 = float.Parse(objxljc.IHP30CCDT70).ToString("0.000");
                sjhxll2 = float.Parse(objxljc.IHP30CCDT50).ToString("0.000");
            }


            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                           m_mainform.jkxlh,
                                                           jkid,
                                                           DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));

                vehispara = stoubao + string.Format(@"<body><vehispara>
                                <tsno>{0}</tsno>
                                <testlineno>{1}</testlineno>
                                <registCode>{2}</registCode>
                                <businessId>{3}</businessId>
                                <zjlx>{4}</zjlx>
                                <cgjlx>{5}</cgjlx>
                                <sdqj1>{6}</sdqj1>
			                    <sdqj2>{7}</sdqj2>
			                    <jcrq>{8}</jcrq>
			                    <jckssj>{9}</jckssj>
                                <sjhxsj1>{10}</sjhxsj1>
			                    <sjhxsj2>{11}</sjhxsj2>
                                <ns1>{12}</ns1>
                                <ns2>{13}</ns2>
                                <myhxsj1>{14}</myhxsj1>
                                <myhxsj2>{15}</myhxsj2>
			                    <zsgl1>{16}</zsgl1>
                                <zsgl2>{17}</zsgl2>
                                <jbgl>{18}</jbgl>
                                <jcjg1>{19}</jcjg1>
                                <jcjg2>{20}</jcjg2>
                                <jcjg>{21}</jcjg>
                                <jcry>{22}</jcry>
                                </vehispara>
			                    </body>
                                </root>",
                             m_mainform.stationCode,
                             m_mainform.lineCode,
                             mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode,
                             mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                             zjlx,
                             "2",
                             sdqj1,
                             sdqj2,
                              DateTime.Now.ToString("yyyy-MM-dd"),
                             objxljc.SlideTimeStart,
                             float.Parse(sjhxsj1).ToString("0.000"),
                             float.Parse(sjhxsj2).ToString("0.000"),
                             float.Parse(objxljc.PLHP70).ToString("0.00"),
                             float.Parse(objxljc.PLHP50).ToString("0.00"),
                             float.Parse(sjhxll1).ToString("0.000"),
                             float.Parse(sjhxll2).ToString("0.000"),
                             tph.Length < 1 ? "1" : float.Parse(tph).ToString("0.00"),
                             tph.Length < 1 ? "1" : float.Parse(tph).ToString("0.00"),
                             float.Parse(objxljc.DIW).ToString("0.00"),
                             "1",
                             "1",
                             "1",
                            objxljc.Checker.Length < 1 ? "蒋佩" : objxljc.Checker);


            string sgc005 = Write(jkid, vehispara, mainform.businessId);
            return sgc005;
        }

        public override string start(string sjylsh, string stime, string sycy, string sczy, bool bqz)
        {
           string result= m_mainform.objbass.WQ001();//智慧
           return result;
        }
        public bool sendOBD(string sjylsh, bool bqz)
        {
            //if (mainform.obdzt.Contains("否"))
            //{
            //    return true;
            //}
            string jyksrq = "";
            string jyjsrq = "";
            string jyy = "";
            string jyjg = "";
            string obdzdyscqy = "";
            string obdzdyxh = "";
            string vin = "";
            string gzjg = "";
            string tx = "";
            string txbz = "";
            string bj = "";
            string bjbz = "";
            string jxxm = "";
            string jxxmbz = "";
            string odometer = "";
            string odomil = "";
            string enginecalid = "";
            string enginecvn = "";
            string hclcalid = "";
            string hclcvn = "";
            string calid = "";
            string cvn = "";
            string iupr = "";
            string gzm;
            string obdtype = "";
            string unFinifishedItemName = "";
            int ijxztcount = 0;
            int igzmcount = 0;
            string sql = string.Format(@"select * from OBD_JCJG  where jylsh ='{0}'  order by OBD_JCJG_ID desc", sjylsh);// DateTime.Now.AddDays(-30), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));

            DataTable dt = objdb.GetTable(sql);
            if (dt.Rows.Count > 0)
            {

                jyksrq = dt.Rows[0]["OBD_JCJG_date"].ToString().Trim();
                jyjsrq = dt.Rows[0]["OBD_JCJG_date"].ToString().Trim();

                jyy = m_mainform.InspectionOperator;
                jyjg = "1";
                obdzdyscqy = m_mainform.OBDqiye;
                obdzdyxh = m_mainform.OBDname;

                string[] obdvin = dt.Rows[0]["OBD_JCJG_CLXX1"].ToString().Trim().Split(',');//发动机控制单元 CAL ID
                if (obdvin[0] != "")
                {
                    vin = obdvin[1];
                }
                else
                {
                    vin = "";
                }
                gzjg = "1";
                bj = "1";
                bjbz = "";
                gzm = "";
                //if (m_mainform.obdsc.Contains("否"))
                {
                    for (int i = 0; i < 7; i++)
                    {

                        if (dt.Rows[0][string.Format("OBD_JCJG_GZM{0}", i + 1)].ToString().Trim().Length > 0)
                        {
                            gzm = dt.Rows[0][string.Format("OBD_JCJG_GZM{0}", i + 1)].ToString().Trim();
                            if (bjbz.Length < 1)
                            {
                                bjbz = dt.Rows[0][string.Format("OBD_JCJG_GZM{0}", i + 1)].ToString().Trim();

                                if (gzm.Contains("P1683") || gzm.Contains("P0538") || gzm.Contains("P0481") || gzm.Contains("P0645") || gzm.Contains("预留") || gzm.Contains("null"))
                                {
                                    bjbz = "";
                                }
                                else
                                {
                                    igzmcount++;
                                }
                            }
                            else
                            {
                                if (gzm.Contains("P1683") || gzm.Contains("P0538") || gzm.Contains("P0481") || gzm.Contains("P0645") || gzm.Contains("预留") || gzm.Contains("null"))
                                {
                                    bjbz = bjbz + "";
                                }
                                else
                                {
                                    bjbz = bjbz + dt.Rows[0][string.Format("OBD_JCJG_GZM{0}", i + 1)].ToString().Trim();
                                    igzmcount++;
                                }

                            }
                        }


                    }
                    if (bjbz.Length > 0)
                    {
                        // bjbz = "";
                        gzjg = "0";
                        bj = "0";
                    }
                }


                tx = "1";
                txbz = "";
                jxxm = "1";
                jxxmbz = "";

                //if (m_mainform.obdsc.Contains("否"))
                {
                    for (int i = 0; i < 10; i++)
                    {
                        int y = 0;
                        if (dt.Rows[0][string.Format("OBD_JCJG_JXZT{0}", i + 1)].ToString().Trim().Contains("未完成"))
                        {
                            jxxm = "0";
                            string sjxztwwc = dt.Rows[0][string.Format("OBD_JCJG_JXZT{0}", i + 1)].ToString().Trim();
                            unFinifishedItemName += sjxztwwc + ";";
                            if (sjxztwwc.Contains("SCR"))
                            {
                                jxxmbz += dt.Rows[0][string.Format("OBD_JCJG_JXZT{0}", i + 1)].ToString().Trim();
                                ijxztcount++;
                            }
                            else if (sjxztwwc.Contains("POC"))
                            {
                                jxxmbz += dt.Rows[0][string.Format("OBD_JCJG_JXZT{0}", i + 1)].ToString().Trim();
                                ijxztcount++;
                            }
                            else if (sjxztwwc.Contains("DOC"))
                            {
                                jxxmbz += dt.Rows[0][string.Format("OBD_JCJG_JXZT{0}", i + 1)].ToString().Trim();
                                ijxztcount++;
                            }
                            else if (sjxztwwc.Contains("DPF"))
                            {
                                jxxmbz += dt.Rows[0][string.Format("OBD_JCJG_JXZT{0}", i + 1)].ToString().Trim();
                                ijxztcount++;
                            }
                            else if (sjxztwwc.Contains("EGR"))
                            {
                                jxxmbz += dt.Rows[0][string.Format("OBD_JCJG_JXZT{0}", i + 1)].ToString().Trim();
                                ijxztcount++;
                            }
                            else if (sjxztwwc.Contains("催化器"))
                            {
                                jxxmbz += dt.Rows[0][string.Format("OBD_JCJG_JXZT{0}", i + 1)].ToString().Trim();
                                ijxztcount++;
                            }
                            else if (sjxztwwc.Contains("氧传感器加热器"))
                            {
                                jxxmbz += dt.Rows[0][string.Format("OBD_JCJG_JXZT{0}", i + 1)].ToString().Trim();
                                ijxztcount++;
                            }
                            else if (sjxztwwc.Contains("氧传感器"))
                            {
                                jxxmbz += dt.Rows[0][string.Format("OBD_JCJG_JXZT{0}", i + 1)].ToString().Trim();
                                ijxztcount++;
                            }
                            else if (sjxztwwc.Contains("可变气门VVT"))
                            {
                                jxxmbz += dt.Rows[0][string.Format("OBD_JCJG_JXZT{0}", i + 1)].ToString().Trim();
                                ijxztcount++;
                            }

                            //if (bjbz.Length < 1)
                            //{
                            //    jxxmbz = dt.Rows[0][string.Format("OBD_JCJG_JXZT{0}", i + 1)].ToString().Trim();
                            //}
                            //else
                            //{
                            //    jxxmbz = bjbz + dt.Rows[0][string.Format("OBD_JCJG_JXZT{0}", i + 1)].ToString().Trim();
                            //}
                            //y++;
                        }

                    }
                }
                for (int i = 0; i < 12; i++)
                {


                    if (dt.Rows[0][string.Format("OBD_JCJG_SJL{0}", i + 1)].ToString().Trim().Contains("里程表"))
                    {
                        string[] obdlc = dt.Rows[0][string.Format("OBD_JCJG_SJL{0}", i + 1)].ToString().Trim().Split(',');
                        if (obdlc[0] != "")
                        {
                            odometer = obdlc[1];
                        }
                        else
                        {
                            odometer = "";
                        }
                    }
                    if (dt.Rows[0][string.Format("OBD_JCJG_SJL{0}", i + 1)].ToString().Trim().Contains("点亮后的行驶距离"))
                    {
                        string[] obdlc = dt.Rows[0][string.Format("OBD_JCJG_SJL{0}", i + 1)].ToString().Trim().Split(',');
                        if (obdlc[0] != "")
                        {
                            odomil = obdlc[1];
                        }
                        else
                        {
                            odomil = "";
                        }
                    }
                    if (dt.Rows[0][string.Format("OBD_JCJG_SJL{0}", i + 1)].ToString().Trim().Contains("车辆OBD类型"))
                    {
                        string[] obdlc = dt.Rows[0][string.Format("OBD_JCJG_SJL{0}", i + 1)].ToString().Trim().Split(',');
                        if (obdlc[0] != "")
                        {
                            obdtype = obdlc[1];
                        }
                        else
                        {
                            obdtype = "EOBD";
                        }

                    }
                }

                string[] obdcalid1 = dt.Rows[0]["OBD_JCJG_CLXX2"].ToString().Trim().Split(',');//发动机控制单元 CAL ID
                if (obdcalid1[0] != "")
                {
                    enginecalid = obdcalid1[1];
                }
                else
                {
                    enginecalid = "";
                }

                string[] obdvin1 = dt.Rows[0]["OBD_JCJG_CLXX3"].ToString().Trim().Split(',');//发动机控制单元 CVN
                if (obdvin1[0] != "")
                {
                    enginecvn = obdvin1[1];
                }
                else
                {
                    enginecvn = "";
                }

                hclcalid = "";
                hclcvn = "";

                if (dt.Rows[0]["OBD_JCJG_CLXX4"].ToString().Trim().Contains("CALID"))//其他发动机控制单元 CAL ID
                {
                    string[] obdcalid2 = dt.Rows[0]["OBD_JCJG_CLXX4"].ToString().Trim().Split(',');
                    if (obdcalid2[0] != "")
                    {
                        calid = obdcalid2[1];
                    }
                    else
                    {
                        calid = "";
                    }
                }
                else
                {
                    calid = "";
                }

                if (dt.Rows[0]["OBD_JCJG_CLXX5"].ToString().Trim().Contains("CVN"))//其他发动机控制单元 CAL ID
                {
                    string[] obdvin2 = dt.Rows[0]["OBD_JCJG_CLXX5"].ToString().Trim().Split(',');
                    if (obdvin2[0] != "")
                    {
                        cvn = obdvin2[1];
                    }
                    else
                    {
                        cvn = "";
                    }
                }
                else
                {
                    cvn = "";
                }


                for (int i = 0; i < 34; i++)
                {
                    if (dt.Rows[0][string.Format("OBD_JCJG_IUPR{0}", i + 1)].ToString().Trim().Length > 0)
                    {

                        //格式化iupr
                    }

                }
                if (ijxztcount >= 2 || igzmcount > 0)
                {
                    jyjg = "0";
                }
                if (jyjg.Contains("0"))
                {
                    string sbhg = string.Format("不合格项目：故障码：{0}\r\n未就绪项目:{1}\r\n是否继续检测？", bjbz, unFinifishedItemName);
                    if (MessageBox.Show(sbhg, "提示", MessageBoxButtons.YesNo) != DialogResult.Yes)
                    {
                        return false;
                    }
                }

                if (bqz)
                {
                    jyjg = "1";
                    gzjg = "1";
                    tx = "1";
                    bj = "1";
                    bjbz = "";
                    jxxm = "1";
                    jxxmbz = "";
                }


                var result = "";
                string vehispara = "";
                string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
                stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                               m_mainform.organ,
                                                               m_mainform.jkxlh,
                                                               "JC011",
                                                               DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
                vehispara = stoubao + string.Format(@"<body><vehispara>                   
                               <jylsh>{0}</jylsh>
                                <registCode>{1}</registCode>
                                <businessId>{2}</businessId>
                                <testtimes>{3}</testtimes>
                                <jyksrq>{4}</jyksrq>
                                <jyjsrq>{5}</jyjsrq>
                                <jyy>{6}</jyy>
                                <jyjg>{7}</jyjg>
                                <obdzdyscqy>{8}</obdzdyscqy>
                                <obdzdyxh>{9}</obdzdyxh>
                                <vin>{10}</vin>
                                <obdyq>{11}</obdyq>
                                <gzjg>{12}</gzjg>
                                <tx>{13}</tx>
                                <txbz>{14}</txbz>
                                <bj>{15}</bj>
                                <bjbz>{16}</bjbz>
                                <jxxm>{17}</jxxm>
                                <jxxmbz>{18}</jxxmbz>
                                <odometer>{19}</odometer>
                                <odomil>{20}</odomil>
                                <enginecalid>{21}</enginecalid>
                                <enginecvn>{22}</enginecvn>
                                <hclcalid>{23}</hclcalid>
                                <hclcvn>{24}</hclcvn>
                                <calid>{25}</calid>
                                <cvn>{26}</cvn>
                                <iupr>{27}</iupr>
                                </vehispara>
			                    </body>
                                </root>",
                                   sjylsh.Length < 1 ? "1" : sjylsh,
                                   "0BB58032-57CF-450B-83FB-E7993D1D0E85",//mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode,//"0BB58032-57CF-450B-83FB-E7993D1D0E85"
                                   sjylsh.Length < 1 ? "1" : sjylsh,
                                   "1",//m_mainform.testtimes,
                                   DateTime.Now.AddSeconds(-30).ToString("yyyy-MM-dd HH:mm:ss"),// jyksrq,
                                   DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),//jyjsrq,
                                   "张先生",//m_mainform.InspectionOperator.Length > 0 ? m_mainform.InspectionOperator : "张先生",//
                                    jyjg,
                                   obdzdyscqy,
                                   obdzdyxh,
                                   vin.Length > 1 ? vin : "VIN",
                                   obdtype,
                                   gzjg,
                                   tx,
                                   txbz,
                                   bj,
                                   bjbz,
                                   jxxm,
                                   jxxmbz,
                                   odometer.Length > 1 ? odometer : "0",
                                   odomil.Length > 1 ? odomil : "0",
                                   enginecalid,
                                   enginecvn,
                                   hclcalid,
                                   hclcvn,
                                   calid,
                                   cvn,
                                   iupr);
                result = Write("JC011", vehispara, sjylsh);

                if (result.Contains("1"))
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
            else
            { 

                    MessageBox.Show("发送OBD时查询不到车辆信息");
                    return false;
            }


        }

        public override string uploadzj(model.尾气自检.jsglv objjsglv)
        {
            float hxsj50 = 0;
            float hxsj40 = 0;
            float hxsj30 = 0;
            float hxsj20 = 0;
            float hxsj10 = 0;
            float jsglv50 = 0;
            float jsglv40 = 0;
            float jsglv30 = 0;
            float jsglv20 = 0;
            float jsglv10 = 0;
            DateTime kaishihxjs50=DateTime.Now;
            DateTime kaishihxjs40 = DateTime.Now;
            DateTime kaishihxjs30 = DateTime.Now;
            DateTime kaishihxjs20 = DateTime.Now;
            DateTime kaishihxjs10 = DateTime.Now;
            DateTime jieshuhxjs50 = DateTime.Now;
            DateTime jieshuhxjs40 = DateTime.Now;
            DateTime jieshuhxjs30 = DateTime.Now;
            DateTime jieshuhxjs20 = DateTime.Now;
            DateTime jieshuhxjs10 = DateTime.Now;

            float.TryParse(objjsglv.hxsj1,out hxsj50);
            float.TryParse(objjsglv.hxsj2, out hxsj40);
            float.TryParse(objjsglv.hxsj3, out hxsj30);
            float.TryParse(objjsglv.hxsj4, out hxsj20);
            float.TryParse(objjsglv.hxsj5, out hxsj10);

            float.TryParse(objjsglv.jsgl1, out jsglv50);
            float.TryParse(objjsglv.jsgl2, out jsglv40);
            float.TryParse(objjsglv.jsgl3, out jsglv30);
            float.TryParse(objjsglv.jsgl4, out jsglv20);
            float.TryParse(objjsglv.jsgl5, out jsglv10);

            DateTime.TryParse(objjsglv.PLTimeStart1, out kaishihxjs50);
            DateTime.TryParse(objjsglv.PLTimeStart2, out kaishihxjs40);
            DateTime.TryParse(objjsglv.PLTimeStart3, out kaishihxjs30);
            DateTime.TryParse(objjsglv.PLTimeStart4, out kaishihxjs20);
            DateTime.TryParse(objjsglv.PLTimeStart5, out kaishihxjs10);
            DateTime.TryParse(objjsglv.SlideTimeEnd1, out jieshuhxjs50);
            DateTime.TryParse(objjsglv.SlideTimeEnd2, out jieshuhxjs40);
            DateTime.TryParse(objjsglv.SlideTimeEnd3, out jieshuhxjs30);
            DateTime.TryParse(objjsglv.SlideTimeEnd4, out jieshuhxjs20);
            DateTime.TryParse(objjsglv.SlideTimeEnd5, out jieshuhxjs10);
            string bdnr = string.Format(@"
                                    <bdnr>
                                    <hxsj1>{0}</hxsj1>
                                    <jsgl1>{1}</jsgl1>
                                    <sdzd1>54</sdzd1>
                                    <sdzx1>46</sdzx1>
                                    <mysd1>50</mysd1>
                                    <jbgl>{2}</jbgl>
                                    <kssj1>{3}</kssj1>
                                    <jssj1>{4}</jssj1>
                                    <hxsj2>{5}</hxsj2>
                                    <jsgl2>{6}</jsgl2>
                                    <sdzd2>44</sdzd2>
                                    <sdzx2>36</sdzx2>
                                    <mysd2>40</mysd2>
                                    <kssj2>{7}</kssj2>
                                    <jssj2>{8}</jssj2>
                                    <hxsj3>{9}</hxsj3>
                                    <jsgl3>{10}</jsgl3>
                                    <sdzd3>34</sdzd3>
                                    <sdzx3>26</sdzx3>
                                    <mysd3>30</mysd3>
                                    <kssj3>{11}</kssj3>
                                    <jssj3>{12}</jssj3>
                                    <hxsj4>{13}</hxsj4>
                                    <jsgl4>{14}</jsgl4>
                                    <sdzd4>24</sdzd4>
                                    <sdzx4>16</sdzx4>
                                    <mysd4>20</mysd4>
                                    <kssj4>{15}</kssj4>
                                    <jssj4>{16}</jssj4>
                                    <hxsj5>{17}</hxsj5>
                                    <jsgl5>{18}</jsgl5>
                                    <sdzd5>14</sdzd5>
                                    <sdzx5>6</sdzx5>
                                    <mysd5>10</mysd5>
                                    <kssj5>{19}</kssj5>
                                    <jssj5>{20}</jssj5>
                                    </bdnr>",
                                    hxsj50.ToString("0.000"),
                                    jsglv50.ToString("0.00"),
                                    objjsglv.DIW,
                                    kaishihxjs50.ToString("yyyy-MM-dd HH:mm:dd"),
                                    jieshuhxjs50.ToString("yyyy-MM-dd HH:mm:dd"),
                                    hxsj40.ToString("0.000"),
                                    jsglv40.ToString("0.00"),
                                    kaishihxjs40.ToString("yyyy-MM-dd HH:mm:dd"),
                                    jieshuhxjs40.ToString("yyyy-MM-dd HH:mm:dd"),
                                    hxsj30.ToString("0.000"),
                                    jsglv30.ToString("0.00"),
                                    kaishihxjs30.ToString("yyyy-MM-dd HH:mm:dd"),
                                    jieshuhxjs30.ToString("yyyy-MM-dd HH:mm:dd"),
                                    hxsj20.ToString("0.000"),
                                    jsglv20.ToString("0.00"),
                                    kaishihxjs20.ToString("yyyy-MM-dd HH:mm:dd"),
                                    jieshuhxjs20.ToString("yyyy-MM-dd HH:mm:dd"),
                                    hxsj10.ToString("0.000"),
                                    jsglv10.ToString("0.00"),
                                    kaishihxjs10.ToString("yyyy-MM-dd HH:mm:dd"), 
                                    jieshuhxjs10.ToString("yyyy-MM-dd HH:mm:dd"));

            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                          m_mainform.jkxlh,
                                                           "BD000",
                                                            DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            vehispara = stoubao + string.Format(@"<body><vehispara>
                                <sbbh>{0}</sbbh>
                                <registCode>{1}</registCode>
                                <businessId>{2}</businessId>
                                <bdsj>{3}</bdsj>
                                <bdr>{4}</bdr>
                                <czr>{5}</czr>
                                <bdlx>{6}</bdlx>
                                <bdnrs>{7}</bdnrs>
                                <bdjg>{8}</bdjg>
                                <tsno>{9}</tsno>
                                <testlineno>{10}</testlineno>              
                                 </vehispara>
			                    </body>
                                </root>",
                       m_mainform.scysbbh,
                       mainform.registCode,
                       mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                       DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                       objjsglv.Checker.Length < 1 ? "蒋佩" : objjsglv.Checker,
                       objjsglv.Checker.Length < 1 ? "蒋佩" : objjsglv.Checker,
                       "03",
                       bdnr,
                       "1",
                       m_mainform.stationCode,
                       m_mainform.lineCode);

            string sgc005;
            sgc005 = Write("BD000_03", vehispara, mainform.businessId);
            return sgc005;
        }

        public override bool stop(string sjylsh, string jyjg)
        {
            var result = "";
            string vehisparajg = "";
            string stoubaojg = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubaojg = stoubaojg + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                           m_mainform.jkxlh,
                                                           "JS001",
                                                           DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));

            vehisparajg = stoubaojg + string.Format(@"<body><vehispara>
                                <jylsh>{0}</jylsh>
                                <businessId>{1}</businessId>
                                <registCode>{2}</registCode>
                                <testtimes>{1}</testtimes>
                                <tsno>{2}</tsno>
                                <testlineno>{3}</testlineno>
                                <license>{4}</license>
			                    <licensecode>{5}</licensecode>
                                <result>{6}</result>
                                </vehispara>
			                    </body>
                                </root>",
                                sjylsh,
                                mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode,
                                m_mainform.testtimes,
                                "",
                                m_mainform.lineCode,
                                mainform.shphm,
                                mainform.shpzl,
                                jyjg);
             result = Write("JS001", vehisparajg, mainform.businessId);
             if (result.Contains("1"))
             {
                 return true;
             }
             else
             {
                 return false;
             }
        }

        public override string uploadzj(model.尾气自检.JDhuaxing objhuaxing)
        {
            string bdnr = "";
            if (objhuaxing.hxqj1.Contains("100"))
            {
                 bdnr = string.Format(@"
                            <bdnr>
                            <hxqj1>{0}</hxqj1>
                            <hxqj2>{1}</hxqj2>
                            <hxqj3>{2}</hxqj3>
                            <hxqj4>{3}</hxqj4>
                            <jzgl1>{4}</jzgl1>
                            <jzgl2>{5}</jzgl2>
                            <jzgl3>{6}</jzgl2>
                            <jzgl4>{7}</jzgl2>
                            <jsgl1>{8}</jsgl1>
                            <jsgl2>{9}</jsgl2>
                            <jsgl3>{10}</jsgl3>
                            <jsgl4>{11}</jsgl4>
                            <hxsj1>{12}</hxsj1>
                            <hxsj2>{13}</hxsj2>
                            <hxsj3>{14}</hxsj3>
                            <hxsj4>{15}</hxsj4>
                            <llsj1>{16}</llsj1>
                            <llsj2>{17}</llsj2>
                            <llsj3>{18}</llsj3>
                            <llsj4>{19}</llsj4>
                            <wc1>{20}</wc1>
                            <wc2>{21}</wc2>
                            <wc3>{22}</wc3>
                            <wc4>{23}</wc4>
                            <jbgl>{24}</jbgl>
                            <hxqj1jcjg>{25}</hxqj1jcjg>
                            <hxqj2jcjg>{26}</hxqj2jcjg>
                            <hxqj3jcjg>{27}</hxqj3jcjg>
                            <hxqj4jcjg>{28}</hxqj4jcjg>
                            </bdnr>",
                        objhuaxing.hxqj1,
                        objhuaxing.hxqj2,
                        objhuaxing.hxqj3,
                        objhuaxing.hxqj4,
                        objhuaxing.jzgl1,
                        objhuaxing.jzgl2,
                        objhuaxing.jzgl3,
                        objhuaxing.jzgl4,
                        objhuaxing.jsgl1,
                        objhuaxing.jsgl2,
                        objhuaxing.jsgl3,
                        objhuaxing.jsgl4,
                        objhuaxing.hxsj1,
                        objhuaxing.hxsj2,
                        objhuaxing.hxsj3,
                        objhuaxing.hxsj4,
                        objhuaxing.llsj1,
                        objhuaxing.llsj2,
                        objhuaxing.llsj3,
                        objhuaxing.llsj4,
                        objhuaxing.wc1,
                        objhuaxing.wc2,
                        objhuaxing.wc3,
                        objhuaxing.wc4,
                        objhuaxing.DIW,
                        objhuaxing.CheckJudge1,
                        objhuaxing.CheckJudge2,
                        objhuaxing.CheckJudge3,
                        objhuaxing.CheckJudge4);
            }
            else
            {
                 bdnr = string.Format(@"
                        <bdnr>
                        <hxqj1>{0}</hxqj1>
                        <hxqj2>{1}</hxqj2>
                        <jzgl1>{2}</jzgl1>
                        <jzgl2>{3}</jzgl2>
                        <jsgl1>{4}</jsgl1>
                        <jsgl2>{5}</jsgl2>
                        <hxsj1>{6}</hxsj1>
                        <hxsj2>{7}</hxsj2>
                        <llsj1>{8}</llsj1>
                        <llsj2>{9}</llsj2>
                        <wc1>{10}</wc1>
                        <wc2>{11}</wc2>
                        <jbgl>{12}</jbgl>
                        <hxqj1jcjg>1</hxqj1jcjg>
                        <hxqj2jcjg>1</hxqj2jcjg>
                        </bdnr>",
            objhuaxing.hxqj1,
            objhuaxing.hxqj2,
            objhuaxing.jzgl1,
            objhuaxing.jzgl2,
            objhuaxing.jsgl1,
            objhuaxing.jsgl2,
            objhuaxing.hxsj1,
            objhuaxing.hxsj2,
            objhuaxing.llsj1,
            objhuaxing.llsj2,
            objhuaxing.wc1,
            objhuaxing.wc2,
            objhuaxing.DIW,
            objhuaxing.CheckJudge1,
            objhuaxing.CheckJudge2);
            }


            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                           m_mainform.jkxlh,
                                                           "BD000",
                                                            DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            vehispara = stoubao + string.Format(@"<body><vehispara>
                                <sbbh>{0}</sbbh>
                                <registCode>{1}</registCode>
                                <businessId>{2}</businessId>
                                <bdsj>{3}</bdsj>
                                <bdr>{4}</bdr>
                                <czr>{5}</czr>
                                <bdlx>{6}</bdlx>
                                <bdnrs>{7}</bdnrs>
                                <bdjg>{8}</bdjg>
                                <tsno>{9}</tsno>
                                <testlineno>{10}</testlineno>              
                                 </vehispara>
			                    </body>
                                </root>",
                                 m_mainform.scysbbh,
                                 mainform.registCode,
                                 mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                 DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                                 m_mainform.sczyxx.Length < 1 ? "蒋佩" : m_mainform.sczyxx,
                                 m_mainform.sczyxx.Length < 1 ? "蒋佩" : m_mainform.sczyxx,
                                 "04",
                                 bdnr,
                                 "1",
                                 m_mainform.stationCode,
                                 m_mainform.lineCode);

            string sgc005 = Write("BD000_04", vehispara, mainform.businessId);

            return sgc005;
        } 

        public override 报告单.modelbgd getbaogaodan(string slsh)//获取登录车辆上线
        {
            string ssql = string.Format("SELECT * FROM SHWD_WJ001,Detects_SJE where SHWD_WJ001.jcCarCheckSerialNumber=Detects_SJE.ASM_JYLSH and SHWD_WJ001.jcCarCheckSerialNumber='{0}'  order by SHWD_WJ001.WJ001_ID", slsh);
            DataTable dt = objdb.GetTable(ssql);
            报告单.modelbgd objbgd = new 报告单.modelbgd();
            if (dt.Rows.Count > 0)
            {
                objbgd.lsh = dt.Rows[0]["ASM_JYLSH"].ToString().Trim();
                objbgd.hphm = dt.Rows[0]["jcCarBrandNumber"].ToString().Trim();
                objbgd.hpys = dt.Rows[0]["jcCarBrandType"].ToString().Trim();
                objbgd.clxh = dt.Rows[0]["jcCarModel"].ToString().Trim();
                objbgd.jzzl = dt.Rows[0]["zbzl"].ToString().Trim();
                objbgd.vin = dt.Rows[0]["jcCarIdentificationNumber"].ToString().Trim();
                objbgd.edzs = dt.Rows[0]["enginespeed"].ToString().Trim();
                objbgd.zdzzl = dt.Rows[0]["gvm"].ToString().Trim();
                objbgd.rllb = dt.Rows[0]["jcCarFuelCategory"].ToString().Trim();
                objbgd.gyfs = "";//供油方式
                objbgd.edgl = dt.Rows[0]["enginepower"].ToString().Trim();
                float fglxz = 0;
                float.TryParse(dt.Rows[0]["enginepower"].ToString().Trim(), out fglxz);
                fglxz = fglxz * 0.4f;
                if (dt.Rows[0]["jcCarCheckMethod"].ToString().Trim().Contains("双怠速"))
                {
                    objbgd.JCFF = string.Format("双怠速法");
                    objbgd.GHC = dt.Rows[0]["HHC"].ToString().Trim();
                    objbgd.GCO = dt.Rows[0]["HCO"].ToString().Trim();
                    objbgd.HC = dt.Rows[0]["LHC"].ToString().Trim();
                    objbgd.CO = dt.Rows[0]["LCO"].ToString().Trim();
                    objbgd.lamda = dt.Rows[0]["HLAMDA"].ToString().Trim();

                    objbgd.GHCXZ = "50";// dt.Rows[0][""].ToString().Trim();
                    objbgd.GCOXZ = "0.3";// dt.Rows[0][""].ToString().Trim();
                    objbgd.HCXZ = "80";// dt.Rows[0][""].ToString().Trim();
                    objbgd.COXZ = "0.6";// dt.Rows[0][""].ToString().Trim();
                    objbgd.lamdaXZ = "0.95-1.05";//dt.Rows[0][""].ToString().Trim();
                }
                else if (dt.Rows[0]["jcCarCheckMethod"].ToString().Trim().Contains("稳态工况法"))
                {
                    objbgd.JCFF = string.Format("ASM工况法");
                    objbgd.ASM25CO = dt.Rows[0]["COER5025"].ToString().Trim();
                    objbgd.ASM25HC = dt.Rows[0]["HCER5025"].ToString().Trim();
                    objbgd.ASM25NO = dt.Rows[0]["NOER5025"].ToString().Trim();
                    objbgd.ASM40CO = dt.Rows[0]["COER2540"].ToString().Trim();
                    objbgd.ASM40HC = dt.Rows[0]["HCER2540"].ToString().Trim();
                    objbgd.ASM40NO = dt.Rows[0]["NOER2540"].ToString().Trim();
                    objbgd.ASM25COXZ = "0.5";// dt.Rows[0][""].ToString().Trim();
                    objbgd.ASM25HCXZ = "90";// dt.Rows[0][""].ToString().Trim();
                    objbgd.ASM25NOXZ = "700";// dt.Rows[0][""].ToString().Trim();
                    if (dt.Rows[0]["COER2540"].ToString().Trim().Length > 0)
                    {
                        objbgd.ASM40COXZ = "0.4";// dt.Rows[0][""].ToString().Trim();
                        objbgd.ASM40HCXZ = "80";// dt.Rows[0][""].ToString().Trim();
                        objbgd.ASM40NOXZ = "650";// dt.Rows[0][""].ToString().Trim();
                    }
                }
                else if (dt.Rows[0]["jcCarCheckMethod"].ToString().Trim().Contains("加载减速法"))
                {
                    objbgd.JCFF = string.Format("加载减速法");
                    objbgd.K100 = dt.Rows[0]["ER1"].ToString().Trim();
                    objbgd.K80 = dt.Rows[0]["ER3"].ToString().Trim();
                    objbgd.NOX80 = dt.Rows[0]["ERNO3"].ToString().Trim();
                    objbgd.VELMaxHP = dt.Rows[0]["velmaxhp"].ToString().Trim();
                    objbgd.SCGL = dt.Rows[0]["SKPower"].ToString().Trim();

                    objbgd.K100XZ = "1.2";// dt.Rows[0][""].ToString().Trim();
                    objbgd.K80XZ = "1.2";// dt.Rows[0][""].ToString().Trim();
                    objbgd.NOX80XZ = "1500";// dt.Rows[0][""].ToString().Trim();
                    objbgd.GLXZ = fglxz.ToString();// dt.Rows[0][""].ToString().Trim();
                }
                else if (dt.Rows[0]["jcCarCheckMethod"].ToString().Trim().Contains("不透光烟度法"))
                {
                    objbgd.JCFF = string.Format("自由加速法");
                    objbgd.K1 = dt.Rows[0]["A_BZY1"].ToString().Trim();
                    objbgd.K2 = dt.Rows[0]["A_BZY2"].ToString().Trim();
                    objbgd.K3 = dt.Rows[0]["A_BZY3"].ToString().Trim();
                    objbgd.KAVG = dt.Rows[0]["A_BZYAVG"].ToString().Trim();
                    objbgd.SCZS = dt.Rows[0]["A_BZS"].ToString().Trim();

                    objbgd.KXZ = "1.2";// dt.Rows[0][""].ToString().Trim();
                }
                objbgd.wendu = dt.Rows[0]["GasWenDu"].ToString().Trim();
                objbgd.shidu = dt.Rows[0]["GasShiDu"].ToString().Trim();
                objbgd.dqiya = dt.Rows[0]["GasYaLi"].ToString().Trim();
                objbgd.wqpd1 = dt.Rows[0]["WQPD"].ToString().Trim().Contains("1") ? true : false;
                objbgd.wqpd2 = dt.Rows[0]["WQPD"].ToString().Trim().Contains("1") ? true : false;
            }
            return objbgd;
        }

        public override string uploadjdsd()
        {
            string bdnr = string.Format(@"
                                    <bdnr>
                                    <csxs>25</csxs>
                                    <sdz1>25</sdz1>
                                    <scz1>24</scz1>
                                    <jdwcz1>1</jdwcz1> 
                                    <xdwcz1>1</xdwcz1> 
                                    <sdz2>40</sdz2> 
                                    <scz2>41</scz2> 
                                    <jdwcz2>1</jdwcz2>
                                    <xdwcz2>2</xdwcz2>
                                    <sdz3>60</sdz3> 
                                    <scz3>59</scz3>  
                                    <jdwcz3>1</jdwcz3> 
                                    <xdwcz3>2</xdwcz3>
                                    </bdnr>");
            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                           m_mainform.jkxlh,
                                                           "BD000",
                                                            DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            vehispara = stoubao + string.Format(@"<body><vehispara>
                                <sbbh>{0}</sbbh>
                                <registCode>{1}</registCode>
                                <businessId>{2}</businessId>
                                <bdsj>{3}</bdsj>
                                <bdr>{4}</bdr>
                                <czr>{5}</czr>
                                <bdlx>{6}</bdlx>
                                <bdnrs>{7}</bdnrs>
                                <bdjg>{8}</bdjg>
                                <tsno>{9}</tsno>
                                <testlineno>{10}</testlineno>              
                                 </vehispara>
			                    </body>
                                </root>",
                                 m_mainform.scysbbh,
                                 mainform.registCode,
                                 mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                 DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                                 m_mainform.sczyxx.Length < 1 ? "蒋佩" : m_mainform.sczyxx,
                                 m_mainform.sczyxx.Length < 1 ? "蒋佩" : m_mainform.sczyxx,
                                 "01",
                                 bdnr,
                                 "1",
                                 m_mainform.stationCode,
                                 m_mainform.lineCode);

            string sgc005 = Write("BD000_01", vehispara, mainform.businessId);
            return sgc005;

        }

        public override string uploadjdli()
        {
            string bdnr = string.Format(@"
                                    <bdnr>
                                    <nlxs>20</nlxs>
                                    <nlsdz1>25</nlsdz1>
                                    <nlscz1>24</nlscz1>
                                    <nlwcz1>1</nlwcz1> 
                                    <nlsdz2>35</nlsdz2>
                                    <nlscz2>34</nlscz2>
                                    <nlwcz2>1</nlwcz2>
                                    <nlsdz3>45</nlsdz3>
                                    <nlscz3>44</nlscz3>
                                    <nlwcz3>1</nlwcz3>  
                                    <nlsdz4>55</nlsdz4>
                                    <nlscz4>54</nlscz4>
                                    <nlwcz4>1</nlwcz4>
                                    <nlsdz5>65</nlsdz5>
                                    <nlscz5>64</nlscz5>
                                    <nlwcz5>1</nlwcz5>
                                    </bdnr>");
            string vehispara = "";
            string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
            stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                           m_mainform.organ,
                                                           m_mainform.jkxlh,
                                                           "BD000",
                                                            DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
            vehispara = stoubao + string.Format(@"<body><vehispara>
                                <sbbh>{0}</sbbh>
                                <registCode>{1}</registCode>
                                <businessId>{2}</businessId>
                                <bdsj>{3}</bdsj>
                                <bdr>{4}</bdr>
                                <czr>{5}</czr>
                                <bdlx>{6}</bdlx>
                                <bdnrs>{7}</bdnrs>
                                <bdjg>{8}</bdjg>
                                <tsno>{9}</tsno>
                                <testlineno>{10}</testlineno>              
                                 </vehispara>
			                    </body>
                                </root>",
                                 m_mainform.scysbbh,
                                 mainform.registCode,
                                 mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                 DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                                 m_mainform.sczyxx.Length < 1 ? "蒋佩" : m_mainform.sczyxx,
                                 m_mainform.sczyxx.Length < 1 ? "蒋佩" : m_mainform.sczyxx,
                                 "02",
                                 bdnr,
                                 "1",
                                 m_mainform.stationCode,
                                 m_mainform.lineCode);

            string sgc005 = Write("BD000_02", vehispara, mainform.businessId);
            return sgc005;
        }

        public override string GetPIC(string zpbh)//长沙发送照片
        {
            if (zpbh == "21" || zpbh == "22" || zpbh == "23" || zpbh == "24" || zpbh == "41" || zpbh == "43" || zpbh == "11" || zpbh == "12" || zpbh == "13" || zpbh == "51" || zpbh == "52" || zpbh == "53")
            {
                return "";
            }
            string zplj = "";
            string sql = string.Format(@"select * from zhaopian where jylsh ='{0}'  ", mainform.businessId);
            DataTable dt = m_mainform.objbass.objdb.GetTable(sql);
            if (dt.Rows.Count > 0)
            {
                zplj = dt.Rows[0]["zp0" + zpbh].ToString().Trim();
            }
            if (zplj.Length > 1)
            {
                string lj = zplj.Replace(m_mainform.wjlj, m_mainform.wjljxn).Replace("xml", "jpg").Replace(@"\", @"/");//平台路劲
                var result = "";
                string vehispara = "";
                string stoubao = "<?xml version=\"1.0\" encoding=\"GBK\"?>";
                stoubao = stoubao + string.Format(@"<root><head><organ>{0}</organ><jkxlh>{1}</jkxlh><jkid>{2}</jkid><sjc>{3}</sjc></head>",
                                                               m_mainform.organ,
                                                              m_mainform.jkxlh,
                                                               "ZP002",
                                                               DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"));
                vehispara = stoubao + string.Format(@"<body><vehispara>
                                <jylsh>{0}</jylsh>
                                <businessId>{1}</businessId>
                                <registCode>{2}</registCode>
                                <testtimes>{3}</testtimes>
                                <tsno>{4}</tsno>
                                <testlineno>{5}</testlineno>
                                <zpbh>{6}</zpbh>
			                    <photo_date>{7}</photo_date>
                                <photo_url>{8}</photo_url>
                                 </vehispara>
			                    </body>
                                </root>",
                                    mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                    mainform.businessId.Length < 1 ? "1" : mainform.businessId,
                                    mainform.registCode.Length < 1 ? "0BB58032-57CF-450B-83FB-E7993D1D0E85" : mainform.registCode,
                                    m_mainform.testtimes,
                                    m_mainform.organ,
                                    m_mainform.lineCode,
                                    zpbh,
                                    DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
                                    lj);//"https://i.loli.net/2020/05/09/ZsGmNiFyOjPeAhQ.jpg");

                result = Write("GetPic" + zpbh, vehispara, mainform.businessId);
                return result;
            }
            else
            {
                return "";
            }
        }
    }
}
